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, ...)
Skill: SUMPRODUCT Change skill (45)

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, ...)
ArgumentWhat it is
array1The 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

Example 1 Total value of an order. Quantity times price for each row (20 + 20 + 36 + 6), added up in one formula.
F2fx=SUMPRODUCT(B2:B5,C2:C5)
ABCDEF
1ItemQtyPriceStoreTotal
2Pens102A82
3Paper45B
4Ink312A
5Tape61B

=SUMPRODUCT(B2:B5,C2:C5) returns 82.

Example 2 Only one store. (D2:D5="A") is 1 for Store A rows and 0 for the rest, so only Pens and Ink are counted.
F2fx=SUMPRODUCT((D2:D5="A")*B2:B5*C2:C5)
ABCDEF
1ItemQtyPriceStoreStore A total
2Pens102A56
3Paper45B
4Ink312A
5Tape61B

=SUMPRODUCT((D2:D5="A")*B2:B5*C2:C5) returns 56.

Example 3 Count with a condition. -- turns TRUE and FALSE into 1 and 0, so this counts the rows with more than 4 items.
F2fx=SUMPRODUCT(--(B2:B5>4))
ABCDEF
1ItemQtyPriceStoreRows over 4
2Pens102A2
3Paper45B
4Ink312A
5Tape61B

=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.

Practise SUMPRODUCT ↑