How to sum products in Excel with SUMPRODUCT

Use SUMPRODUCT when you need to multiply values in corresponding positions and then add the products. For example, you can compute total sales from unit prices and quantities without a separate revenue column.

Match the ranges before calculating

Use ranges with the same number of rows and columns. Even equal-sized ranges can pair the wrong products if one starts a row later. Check the first and last row of each range. Mismatched dimensions produce a #VALUE! error.

Microsoft Support syntax and range rules for SUMPRODUCT

Calculate total sales from price and quantity

On a blank sheet, enter the product groups A, B, and C in A2:A4. Enter prices 1000, 2000, and 3000 in B2:B4 and quantities 10, 20, and 30 in C2:C4. Put the following formula in an empty cell.

=SUMPRODUCT(B2:B4,C2:C4)

The row totals are 10000, 40000, and 90000. The formula adds them and returns 140000.

Add profit margins to calculate total profit

Enter 5%, 10%, and 8% in D2:D4. If each percentage is the share of that row’s sales kept as profit, pass all three ranges to the function.

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

The first row contributes 1000 × 10 × 5%, or 500. The next two contribute 4000 and 7200, so total profit is 11700. Averaging the three rates first would give the same weight to rows with different sales amounts.

Sum sales only for matching rows

Change C in A4 to A, so A2:A4 reads A, B, A. This formula includes sales only from rows marked A.

=SUMPRODUCT((A2:A4="A")*B2:B4*C2:C4)

Multiplication treats each true condition as 1 and each false one as 0. The middle row contributes zero. Adding 10000 and 90000 gives 100000.

Separate array arguments treat nonnumeric entries as zero. Direct multiplication, as in the condition formula, can behave differently if a cell contains text, so check that prices and quantities are numeric.

If the total is unexpected, check the dimensions, starting rows, and source errors. Filtering can hide rows without removing them from the calculation. Use a different method if the result must reflect visible rows only.

Avoid full-column references. Use the actual data ranges or table columns so the formula does not calculate over unused cells.