Function · Math

Excel SUMPRODUCT function

The Excel SUMPRODUCT function multiplies matching rows and adds the products. Two milks, one dozen eggs, and three oat milks total $25.64.

All current Excel versions. Also in Excel for the web and Google Sheets.

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

SUMPRODUCT
=SUMPRODUCT(B2:B4,C2:C4)

Arguments

NameRequiredWhat to pass
array1RequiredThe first range. With a second range, each row is multiplied and the products are added.
array2OptionalAnother range of the same size. Text in a range you are multiplying as numbers causes #VALUE!.

Examples

A three-line grocery extension

=SUMPRODUCT(B2:B4,C2:C4)

Result $25.64

=SUMPRODUCT(B2:B4,C2:C4)C5
Cart
ABC
1ItemQtyPrice
2Whole milk23.49
3Eggs14.29
4Oat milk34.79
5Total25.64
A picture of the sheet, not a live calculator.

SUMPRODUCT multiplies rows together and adds those products. Two gallons at $3.49 is $6.98, one dozen eggs at $4.29 is $4.29, and three cartons of oat milk at $4.79 is $14.37. The total is $25.64. You do not need a helper column of line totals.

The ranges must be the same size. Text in a numeric range is a #VALUE! error, not a skipped cell, which is stricter than SUM. SUMSQ skips that text inside a range and adds squares. SUMSQ(3, 4) is 25. People also use SUMPRODUCT for AND-style counts, multiplying a TRUE/FALSE test by an amount. That works because TRUE becomes 1 and FALSE becomes 0 when you multiply. It is harder to read than SUMIFS. Prefer SUMIFS unless you are stuck on an older file or you need OR logic that SUMIFS will not express.