# E1 | anthropic/claude-opus-5 | run 1

## Prompt

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

## Response

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

This adds up every value in column B whose same-row cell in column A is exactly "Paid" (case-insensitive).

## Variations

**Reference a cell instead of hardcoding the text**

```excel
=SUMIF(A:A,D1,B:B)
```

**Limit to a defined range (faster on large sheets)**

```excel
=SUMIF(A2:A1000,"Paid",B2:B1000)
```

**Multiple conditions** — e.g., "Paid" *and* amount over 100:

```excel
=SUMIFS(B:B,A:A,"Paid",B:B,">100")
```

**Exact, case-sensitive match** (SUMIF ignores case, so use SUMPRODUCT):

```excel
=SUMPRODUCT(EXACT(A2:A1000,"Paid")*B2:B1000)
```

## Notes

- Order of arguments differs: `SUMIF(range, criteria, sum_range)` puts the test range first, while `SUMIFS(sum_range, range1, criteria1, ...)` puts the sum range first.
- Avoid wildcards unintentionally: `"Paid"` won't match "Paid in full". Use `"Paid*"` if you want prefix matching.
- Trailing spaces in your data ("Paid ") will break the match — wrap with `TRIM` in a helper column or clean the source data.

Reference: [SUMIF function](https://support.microsoft.com/en-us/office/sumif-function-169b8c99-c05c-4483-a712-1697a653039b) and [SUMIFS function](https://support.microsoft.com/en-us/office/sumifs-function-c9e748f5-7ea7-455d-9406-611cebce642b).

Would you like a version that also counts the "Paid" rows or breaks the totals down by month?
