# E1 | moonshotai/kimi-k3 | 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

Use `SUMIF`, which adds values in a sum range wherever a criterion is met in a lookup range. Here, it sums column B wherever column A equals "Paid".

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

- `A:A` — the range checked against your criterion
- `"Paid"` — the condition (text matches are case-insensitive, so "paid" and "PAID" also match)
- `B:B` — the range to sum

This works identically in Excel and Google Sheets. To limit the range for performance, use something like `=SUMIF(A2:A1000, "Paid", B2:B1000)`. If you later need multiple conditions (e.g., "Paid" in A *and* a date range in C), switch to `SUMIFS`:

```excel
=SUMIFS(B:B, A:A, "Paid", C:C, ">=1/1/2026")
```

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

Do you need to add more conditions, such as filtering by date or excluding certain rows?
