Multiply, then sum arrays
=SUMPRODUCT(array1, [array2], ...)
| Parameter | Description |
|---|---|
array1 |
The first array or range to multiply, then add. |
array2 |
[optional] The second array or range to multiply, then add. |
To perform this calculation, SUMPRODUCT uses values in columns D and E directly like this:
=SUMPRODUCT(D5:D14,E5:E14) // returns 1612
The result is the same as summing all values in column F. The formula is evaluated like this:
=SUMPRODUCT(D5:D14,E5:E14)
=SUMPRODUCT({10;6;14;9;11;10;8;9;11;10},{15;18;15;16;18;18;15;16;18;16})
=SUMPRODUCT({150;108;210;144;198;180;120;144;198;160})
=1612
A typical use for the SUMPRODUCT function is to calculate conditional sums, much like you would use a function like SUMIFS. In the worksheet shown bel
=SUMPRODUCT(--(C5:C14="red"),F5:F14) // red
=SUMPRODUCT(--(B5:B14="tx"),--(C5:C14="red"),F5:F14) // tx and red
=SUMPRODUCT(--(B5:B14="co"),--(C5:C14="blue"),F5:F14) // co and blue
=SUMPRODUCT(--(C5:C14<>"red"),F5:F14) // not red
Using SUMPRODUCT, you can sum total sales for Texas ("TX") with this formula:
=SUMPRODUCT(--(A2:A6="TX"),B2:B6)
You can also count total sales for Texas ("TX") with this formula:
=SUMPRODUCT(--(A2:A6="TX"))
Now SUMPRODUCT can perform the calculation successfully. In array terms, the formula evaluates like this:
=SUMPRODUCT({0,0,1,0,1},{75,100,125,125,150})