East total, written as a product
On the four-order sheet, East amounts are 10, 30, and 20. SUMPRODUCT multiplies each amount by 1 or 0 depending on the region. SUMIFS states the same filter without the multiplication.
East 10, West 40, East 30, East 20.| Row | A | B | C |
|---|
| 1 | Region | Product | Amount |
|---|
| 2 | East | Pen | 10 |
|---|
| 3 | West | Pen | 40 |
|---|
| 4 | East | Book | 30 |
|---|
| 5 | East | Pen | 20 |
|---|
=SUMPRODUCT((A2:A5="East")*(C2:C5)) → 60=SUMIFS(C2:C5,A2:A5,"East") → 60=SUMPRODUCT((A2:A5="East")*(B2:B5="Pen")*(C2:C5)) → 30
The East test is 1, 0, 1, 1 down the rows. Times the amounts 10, 40, 30, 20 that is 10, 0, 30, 20, and the sum is 60. Multiplying a second test, product Pen, also zeroes the East Book, leaving 10 and 20, which sum to 30. SUMIFS is the clearer way to ask for the East total. The product earns its place when more row math has to happen inside the same formula.
Pen or Book, with Lamp excluded
Addition of two tests is OR. A row that is Pen or Book contributes its amount. Lamp must not. This sheet adds a North Lamp of 7 so the OR total is not the same as the grand total.
Pen 10, Pen 40, Book 30, Lamp 7.| Row | A | B | C |
|---|
| 1 | Region | Product | Amount |
|---|
| 2 | East | Pen | 10 |
|---|
| 3 | West | Pen | 40 |
|---|
| 4 | East | Book | 30 |
|---|
| 5 | North | Lamp | 7 |
|---|
=SUMPRODUCT(((B2:B5="Pen")+(B2:B5="Book"))*(C2:C5)) → 80=SUM(C2:C5) → 87
Pen rows and the Book row contribute 10+40+30. Lamp contributes 0 because both tests are false. The sum is 80. SUM of the whole amount column is 87, which still includes the 7. A row that made both tests true would be counted twice. Product names cannot do that. Overlapping numeric tests can.