Free SUMPRODUCT practice
SUMPRODUCT practice exercises
SUMPRODUCT multiplies matching values in two or more ranges and adds up the results. 5 reps, from easy to hard, each checked in a real spreadsheet engine. 2 free, 3 with Pro.
=SUMPRODUCT(array1, array2, ...)
SUMPRODUCT guide
How to use SUMPRODUCT in Excel
SUMPRODUCT multiplies matching values in two or more ranges and adds up the results. The classic use is a total of quantity times price without a helper column. It can also count or sum with conditions, in any version of Excel.
All the ranges must be the same size.
Syntax
=SUMPRODUCT(array1, array2, ...)
| Argument | What it is |
|---|---|
array1 | The first range, such as quantities in B2:B5. |
array2, ... | More ranges of the same size, such as prices in C2:C5. Each row is multiplied across, then the products are added. |
Examples
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Qty | Price | Store | Total | |
| 2 | Pens | 10 | 2 | A | 82 | |
| 3 | Paper | 4 | 5 | B | ||
| 4 | Ink | 3 | 12 | A | ||
| 5 | Tape | 6 | 1 | B |
=SUMPRODUCT(B2:B5,C2:C5) returns 82.
(D2:D5="A") is 1 for Store A rows and 0 for the rest, so only Pens and Ink are counted.| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Qty | Price | Store | Store A total | |
| 2 | Pens | 10 | 2 | A | 56 | |
| 3 | Paper | 4 | 5 | B | ||
| 4 | Ink | 3 | 12 | A | ||
| 5 | Tape | 6 | 1 | B |
=SUMPRODUCT((D2:D5="A")*B2:B5*C2:C5) returns 56.
-- turns TRUE and FALSE into 1 and 0, so this counts the rows with more than 4 items.| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Qty | Price | Store | Rows over 4 | |
| 2 | Pens | 10 | 2 | A | 2 | |
| 3 | Paper | 4 | 5 | B | ||
| 4 | Ink | 3 | 12 | A | ||
| 5 | Tape | 6 | 1 | B |
=SUMPRODUCT(--(B2:B5>4)) returns 2.
Common mistakes
Ranges of different sizes
Every range must have the same number of rows. C2:C4 is one row short.
Wrong=SUMPRODUCT(B2:B5,C2:C4) → #VALUE!
Right=SUMPRODUCT(B2:B5,C2:C5) → 82
Multiplying the totals
Total quantity times total price is not the order value. Each quantity must be multiplied by its own price before adding.
Wrong=SUM(B2:B5)*SUM(C2:C5) → 460
Right=SUMPRODUCT(B2:B5,C2:C5) → 82
SUMPRODUCT questions
When should I use SUMPRODUCT instead of SUMIFS?
When you need to multiply before adding (quantity times price), or when a condition is more complex than SUMIFS allows, such as a test on a calculation.
What does the double minus (--) do?
It turns TRUE and FALSE into 1 and 0, so SUMPRODUCT can add them up as a count.
Can SUMPRODUCT use OR conditions?
Yes, by adding the tests: =SUMPRODUCT(((D2:D5="A")+(D2:D5="B")>0)*B2:B5) adds quantities for Store A or B.
Related functions
Reading is the warm-up
The reps are what make it stick. Try SUMPRODUCT in the practice sheet above.