SUMPRODUCT: total revenue in one formula

Lesson 28 of 54

SUMPRODUCT multiplies matching items in two or more ranges and adds up the results, such as quantity times price for a whole order. It can also total with conditions, in any version of Excel and in Google Sheets.

In cell E2, write one formula that multiplies each Price by its Units and adds them all up.

E2
ABCDE
1ItemPriceUnitsTotal revenue
2Mug840
3Shirt1525
4Cap1230
5Bag2010

Type in the formula bar above and press Enter to check.

Skip

How SUMPRODUCT works

Syntax

=SUMPRODUCT(array1, [array2], ...)
array1
The first range of numbers.
array2, ...
Optional. More ranges of the same size; matching items are multiplied together.

Example

Scores are in B2:B5 and their weights (20%, 30%, 30%, 20%) in C2:C5. You want the weighted average.

=SUMPRODUCT(B2:B5, C2:C5)

Multiplies each score by its weight and adds them up. If the weights don't add to 100%, divide by SUM(C2:C5).

Common mistakes

  • Ranges of different sizes, which gives #VALUE!. B2:B5 and C2:C6 don't match.
  • Text or blank-looking cells that hold spaces. They count as 0 or cause errors.
  • Using commas between conditions: =SUMPRODUCT((A2:A9="North"),B2:B9) adds nothing. Multiply instead: =SUMPRODUCT((A2:A9="North")*B2:B9).

Questions people ask

How do I use SUMPRODUCT with a condition?

Multiply by a TRUE/FALSE test: =SUMPRODUCT((A2:A100="North")*B2:B100*C2:C100) totals price times units for North only.

How do I calculate a weighted average?

=SUMPRODUCT(values, weights)/SUM(weights).

Practice it above: type the formula in the formula bar and press Enter to check.