Table of Contents
In Excel, SUMPRODUCT multiplies matching cells and adds the results. If C2:C4 holds quantities and D2:D4 holds unit prices, =SUMPRODUCT(C2:C4,D2:D4) returns total revenue without a separate calculation column.
Syntax and range rules
=SUMPRODUCT(array1, [array2], [array3], …)
Provide at least one array. Array arguments must have the same number of rows and columns. With separate array arguments, Excel treats nonnumeric entries as zero. If you multiply ranges with * inside the function, text in those ranges can cause an error. See Microsoft’s SUMPRODUCT reference for the documented behavior.
Multiply quantity by price, then add the rows

=SUMPRODUCT(C2:C4,D2:D4)


Excel calculates C2*D2+C3*D3+C4*D4. Two rows of 4 books at 10 each and 3 books at 20 each would give 4*10+3*20=100. For a refresher on cell references, see how to build and check basic spreadsheet formulas.
Include only the rows that meet a condition
Match a category

=SUMPRODUCT(--(A2:A6="Vietnamese Books"),B2:B6,C2:C6)
The comparison tests each category in column A. The double minus turns matches into 1 and other rows into 0. Excel multiplies those values by the quantities in B and prices in C. Use the category text exactly as it appears in your sheet.


Match a quantity limit
=SUMPRODUCT(--(B2:B6<=30),B2:B6,C2:C6)
<=30 includes rows with a quantity of exactly 30. Use <30 if those rows should be excluded. To apply both conditions, include both comparisons as separate arguments before the quantity and price ranges.


Fix #VALUE! or an unexpected zero
- #VALUE!: Check that all ranges have matching dimensions and line up with the same data rows. Look for text or errors if you used multiplication inside the formula.
- Unexpected zero: Check whether the criteria match any rows and whether your quantities or prices are stored as text. Test questionable cells with
ISNUMBER. - Slow calculation: Reference the actual data range or use table columns instead of entire worksheet columns.
The same pattern applies to a weighted average in Excel: divide SUMPRODUCT(values,weights) by SUM(weights) when the total weight is nonzero.
Reader Comments 0
Sign in with email or Google to join the discussion.