# E1 | deepseek/deepseek-v4-pro | 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

To sum all values in column B where the corresponding cell in column A equals “Paid,” use the `SUMIF` function, which works identically in Microsoft Excel and Google Sheets.

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

That single formula scans column A for the exact text “Paid” and adds the matching numbers from column B. It automatically includes new rows added later because the entire columns are referenced.

### How it works
- **A:A** – the criteria range (column A)
- **"Paid"** – the condition (case-insensitive in Google Sheets, case-insensitive by default in Excel)
- **B:B** – the values to sum (column B)

If you only need a specific range of rows (for example, to avoid headers or footers), replace the column references with actual ranges such as `=SUMIF(A2:A100, "Paid", B2:B100)`.

For multiple conditions (e.g., “Paid” and a date range), use `SUMIFS` with the syntax `=SUMIFS(B:B, A:A, "Paid", C:C, ">=2026-01-01")`.

---

Would you also like a formula to count how many rows are marked “Paid,” or something that handles partial text matches?
