# E1 | meta/muse-spark-1.1 | 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

Use this formula to sum column B only where column A is exactly "Paid":

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

This works identically in both Excel and Google Sheets. It's case-insensitive and ignores blank cells.

## Best variations to use

**1. For a specific range (recommended for performance):**
```excel
=SUMIF(A2:A1000, "Paid", B2:B1000)
```

**2. For multiple conditions (e.g., Paid and in 2024):**
Use SUMIFS where the sum range comes first:
```excel
=SUMIFS(B:B, A:A, "Paid", C:C, 2024)
```

**3. For Google Sheets alternative:**
```excel
=SUM(FILTER(B:B, A:A="Paid"))
```

## How it works
- `A:A` is the range to check
- `"Paid"` is the criteria to match
- `B:B` is the range to sum

If your data is in an Excel Table named `Table1`, use structured references:
```excel
=SUMIF(Table1[Status], "Paid", Table1[Amount])
```

Do you need it to match partial text like "Paid - Partial" as well, or only exact matches for "Paid"?
