Price times quantity with SUMPRODUCT

Summaries and rankings · About 5 minutes

Price times quantity with SUMPRODUCT

SUMPRODUCT multiplies two ranges row by row, then adds up the results. =SUMPRODUCT(B2:B6,C2:C6) is B2*C2 plus B3*C3, and so on down to row 6.

It's the one-cell way to total an order (price times quantity), a payroll (hours times rate) or a weighted grade (weight times score).

Both ranges must be the same size. SUM(B2:B6)*SUM(C2:C6) is not the same thing: it multiplies the two totals, which mixes up every row.

Part of Plus

Free during our founding launch: sign in to unlock this lesson's exercises, the timed practice sets and the rest of Plus. The free lessons stay free, with no account needed.

What SUMPRODUCT does

SUMPRODUCT multiplies two ranges row by row, then adds the results. It does in one cell what would otherwise need a helper column of multiplications and a SUM under it.

Use it whenever a total is "this times that, added up": boxes times weight per box, units times price, hours times rate. Both ranges must cover the same rows so each pair lines up.

How to write SUMPRODUCT

=SUMPRODUCT(array1, [array2], ...)

array1
The first range of numbers, like the number of boxes.
array2
The range to multiply it by, row by row, like kg per box. It's optional, but a single range just adds up.
...
Optional. More ranges of the same size; each row's values are all multiplied together.

SUMPRODUCT worked example

A food bank logs how many boxes of each item arrived and how much each box weighs. In C9, find the total weight.

A food bank logs how many boxes of each item arrived and how much each box weighs. In C9, find the total weight.
ABC
1ItemBoxesKg/box
2Rice410
3Flour225
4Sugar65
5Oats38
6Salt101
7Beans54
8
9Total kg174
C9=SUMPRODUCT(B2:B7,C2:C7)Multiply the boxes by the kg per box on each row, then add them up: 40 + 50 + 30 + 24 + 10 + 20 = 174.

Common SUMPRODUCT mistakes

A much bigger total than expected

Use SUMPRODUCT instead of SUM(B2:B7)*SUM(C2:C7). Multiplying the two totals pairs every row with every other row.

#VALUE! as soon as you press Enter

Make both ranges the same size, like B2:B7 and C2:C7. One range a row short leaves a value with nothing to multiply.

A row seems to be left out

Check for a number stored as text. In Excel, SUMPRODUCT counts anything that isn't a number as 0; VALUE turns it back into a number.

SUMPRODUCT or a helper column?

A helper column (say D2 = B2*C2, filled down, then a SUM) shows each line's result, which is handy to check. SUMPRODUCT gives the same total in one cell with no extra column, so the sheet stays tidy.

Dividing SUMPRODUCT by the SUM of the weights gives a weighted average; our weighted average guide walks through it. SUMPRODUCT works in every version of Excel and in Google Sheets.

Questions people ask

What does SUMPRODUCT do?

It multiplies two ranges row by row, then adds the results: =SUMPRODUCT(B2:B6,C2:C6) is B2*C2 + B3*C3 and so on.

Why not multiply the two totals?

SUM(B2:B6)*SUM(C2:C6) mixes every row with every other. SUMPRODUCT pairs each price with its own quantity.

Why does SUMPRODUCT give #VALUE!?

The ranges are different sizes. Both must cover the same rows.

Can SUMPRODUCT do a weighted average?

Yes: =SUMPRODUCT(B2:B6,C2:C6)/SUM(C2:C6), with the weights in C.