Excel SUMPRODUCT function
SUMPRODUCT multiplies columns row by row and then adds the results, which is exactly the shape of quantity × price. Its second job matters more: multiply TRUE/FALSE conditions into the arrays and you can express things SUMIFS cannot — OR logic, between-limits tests, distinct counts. No Ctrl+Shift+Enter, and it works in every version.
Math & conditional sums · Available in: Excel 97 and every desktop version since
Syntax
SUMPRODUCT(array1, [array2], ...)What it returns The sum of the products of corresponding items; with one array, the sum of that array.
| Arguments | ||
|---|---|---|
| array1 | required | Two or more arrays of identical size; corresponding items are multiplied, then summed. |
| array2 | optional | 后续数组,尺寸必须与第一个一致。 |
Examples
Quantity × price, one region only
| Region | Units | Price |
| North | 3 | 120 |
| South | 5 | 80 |
| North | 2 | 120 |
= SUMPRODUCT((A2:A4="North")*B2:B4*C2:C4)→ 600
The condition produces {TRUE;FALSE;TRUE}, which multiplies through the quantities and prices to {360;0;240}, totalling 600. TRUE counts as 1 and FALSE as 0, so non-matching rows fall out on their own.
Either of two regions (OR)
| Region | Amount |
| North | 1200 |
| South | 800 |
| West | 450 |
= SUMPRODUCT(((A2:A4="North")+(A2:A4="West"))*B2:B4)→ 1650
The two conditions are joined with a plus, so either one yields 1; multiply by the amount and sum. SUMIFS cannot do this — it only knows AND.
Common mistakes
- 1.Different-sized arrays return #VALUE!; every array being multiplied must have the same shape.
- 2.Whole-column references (A:A) in the conditions force a million-row scan and take seconds. Bound the ranges to the real data.
- 3.Missing brackets in a condition: A2:A4="North"*B2:B4 is parsed as multiplication first and gives nonsense.
- 4.Joining OR conditions with * and AND with + — the semantics are the other way round.
How to use it
- 1.Click the cell where the result should appear.
- 2.Type = then the function name, and press Tab to accept it.
- 3.Enter each argument separated by commas; ranges can be dragged with the mouse.
- 4.Press Enter. Drag the fill handle down if the same formula applies to more rows.
Frequently asked questions
What is the syntax of SUMPRODUCT?
SUMPRODUCT(array1, [array2], ...). What it returns: The sum of the products of corresponding items; with one array, the sum of that array.
Which Excel versions support SUMPRODUCT?
Excel 97 and every desktop version since. It is available in every desktop version unless the note above says otherwise.
Why does SUMPRODUCT return an error instead of a value?
Different-sized arrays return #VALUE!; every array being multiplied must have the same shape.