# E1 | anthropic/claude-haiku-4.5 | run 2

## Prompt

Write a spreadsheet formula (Excel/Sheets) that sums all values in column B where the matching cell in column A equals 'Paid'.

## Response

Here's the formula you need:

```excel
=SUMIF(A:A,"Paid",B:B)
```

This formula scans all cells in column A for the text "Paid" and sums the corresponding values from column B. It works identically in both Excel and Google Sheets.

**Alternative syntax:**

If you prefer to specify an exact range instead of entire columns:

```excel
=SUMIF(A1:A1000,"Paid",B1:B1000)
```

This limits the search to rows 1–1000, which is more efficient for large datasets.

**Case sensitivity note:** SUMIF is case-insensitive by default. If you need exact case matching, use SUMPRODUCT instead:

```excel
=SUMPRODUCT((A:A="Paid")*(B:B))
```

Do you need to filter by multiple conditions (for example, "Paid" AND a specific date range)?
