# E1 | x-ai/grok-4.3 | 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

The standard approach uses the SUMIF function to conditionally sum values based on matching criteria in a separate column.

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

This formula works identically in both Microsoft Excel and Google Sheets. It scans all of column A for the exact text "Paid", then adds the corresponding values from the same rows in column B.

**How it works**  
- The first argument (A:A) defines the criteria range.  
- The second argument ("Paid") specifies the exact match required.  
- The third argument (B:B) identifies the values to sum when the match occurs.  

Replace the full-column references with specific ranges such as A2:A1000 and B2:B1000 for better performance on large datasets.

Do you need a version that handles multiple criteria or partial text matches?
