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

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

This formula works identically in both Excel and Google Sheets. It checks every cell in column A, and where the value equals "Paid", it adds the corresponding value from column B to the total.

## How It Works

| Argument | Value | Purpose |
|---|---|---|
| `range` | `A:A` | The column to evaluate against your criteria |
| `criteria` | `"Paid"` | The text to match (case-insensitive) |
| `sum_range` | `B:B` | The column containing values to sum |

## Notes

- Text criteria must be wrapped in double quotes.
- If your data has headers or a fixed range, use something like `=SUMIF(A2:A100, "Paid", B2:B100)` for slightly better performance.
- For multiple conditions (e.g., "Paid" in column A *and* a date in column C), use `SUMIFS` instead: `=SUMIFS(B:B, A:A, "Paid", C:C, ">1/1/2026")`.

See the official documentation for [SUMIF in Excel](https://support.microsoft.com/en-us/office/sumif-function-169b8c99-c05c-4483-a712-1697a653039b) or [SUMIF in Google Sheets](https://support.google.com/docs/answer/3093583).

Would you like a version that handles multiple criteria or partial text matches?
