What you will learn
- Count rows that pass a test with SUMPRODUCT
- Count rows that pass two tests
How it works
=SUMPRODUCT((C2:C9>500)*1) counts the amounts over 500.
For two tests, multiply them: =SUMPRODUCT((B2:B9="West")*(C2:C9>300)).
Formulas at a glance
=SUMPRODUCT((C2:C9>500)*1) | count one test |
=SUMPRODUCT((B2:B9="West")*(C2:C9>300)) | count two tests |
Example
Write the formula with SUMPRODUCT to count the orders over 500.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Order | Region | Amount | Status | ||
| 2 | 1001 | West | $820.00 | Shipped | Over 500 | |
| 3 | 1002 | East | $240.00 | Pending | West over 300 | |
| 4 | 1003 | North | $510.00 | Shipped | ||
| 5 | 1004 | West | $130.00 | Shipped | Under 400 | |
| 6 | 1005 | South | $975.00 | Pending | East shipped | |
| 7 | 1006 | East | $660.00 | Shipped | ||
| 8 | 1007 | West | $390.00 | Pending |
Click G2 and type =SUMPRODUCT((C2:C9>500)*1), then press Enter.
The answer is 4.
When to use it
- Counting orders over an amount
- Counting rows that pass two tests
- Counts COUNTIFS can’t do
Common mistakes
- Getting 0 with one testMultiply by 1 to turn TRUE/FALSE into numbers: (C2:C9>500)*1.
- Ranges of different sizesAll ranges must cover the same rows.
- Adding tests for ANDMultiply for AND. Add for OR.
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.