What you will learn
- Turn a test into 1s and 0s
- Add only matching rows with SUMPRODUCT
How it works
(B2:B9="West") checks every row. When you multiply, TRUE counts as 1 and FALSE as 0.
=SUMPRODUCT((B2:B9="West")*C2:C9) adds only the West amounts.
Formulas at a glance
=SUMPRODUCT((B2:B9="West")*C2:C9) | one condition |
=SUMPRODUCT((B2:B9="East")*(D2:D9="Shipped")*C2:C9) | two |
Example
Write the formula with SUMPRODUCT to add up the West amounts.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Order | Region | Amount | Status | ||
| 2 | 1001 | West | $820.00 | Shipped | West total | |
| 3 | 1002 | East | $240.00 | Pending | East shipped | |
| 4 | 1003 | North | $510.00 | Shipped | ||
| 5 | 1004 | West | $130.00 | Shipped | North total | |
| 6 | 1005 | South | $975.00 | Pending | West pending | |
| 7 | 1006 | East | $660.00 | Shipped | ||
| 8 | 1007 | West | $390.00 | Pending |
Click G2 and type =SUMPRODUCT((B2:B9="West")*C2:C9), then press Enter.
The answer is $1,340.00.
When to use it
- Totals with conditions in any version of Excel
- Totals with tests SUMIFS can’t do
- Adding rows that match two or more tests
Common mistakes
- Ranges of different sizesEvery range must cover the same rows.
- Forgetting the parentheses around testsEach test needs its own ( ).
- Using commas between testsMultiply the tests with * so they work as AND.
Practice it on a real sheet
Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.