Excel SUMPRODUCT Function (Example + Video)

When to use Excel SUMPRODUCT Function
SUMPRODUCTÂ function can be used when you want to first multiply two or more sets to arrays and then get its sum.
What it Returns
It returns a number that represents the sum of the product of two or more arrays.
Syntax
=SUMPRODUCT(array1, [array2], [array3], …)
Input Arguments
- array1 –Â The first array argument whose components you want to multiply and then add.
- [array 2] – (optional) Second array arguments whose components you want to multiply and then add. There can be a maximum of up to 255 arrays that can be used in SUMPRODUCT function.
Additional Notes
- The size of all the arrays must be the same.
- Non-numeric entries are treated as 0.
Excel SUMPRODUCT Function – Live Example
SUMPRODUCT With Multiple Criteria
One of my favorite uses of SUMPRODUCT is adding up numbers that meet two or more conditions at once. It even works in older Excel versions that don’t have SUMIFS.
Say I have sales data with the Region in column B, the Product in column C, and the Sale amount in column D (rows 2 to 11). I want the total sales where the Region is East AND the Product is Laptop.
Here’s the formula I’d use:
=SUMPRODUCT((B2:B11="East")*(C2:C11="Laptop")*D2:D11)
This returns 4200, the total of every sale that is both from the East and a Laptop.
Here’s why it works. Each condition like (B2:B11=”East”) returns an array of TRUE and FALSE values. When you multiply arrays, Excel reads TRUE as 1 and FALSE as 0.
So a row becomes 1 only when both conditions are true, and 0 when either one fails. Multiply that by column D and only the matching sales survive. SUMPRODUCT then adds them up.
Want an OR instead of an AND? Add the condition arrays rather than multiplying them, and wrap them in a >0 check so rows that match both aren’t counted twice:
=SUMPRODUCT(((B2:B11="East")+(C2:C11="Laptop")>0)*D2:D11)
This returns 8250, the total of every sale that is either from the East or a Laptop (or both).
Pro Tip: This SUMPRODUCT trick was the standard way to do multi-criteria sums before SUMIFS came along. On a modern Excel, =SUMIFS(D2:D11,B2:B11,”East”,C2:C11,”Laptop”) gives the same 4200 and reads easier. SUMPRODUCT still wins when you need math on the criteria themselves that SUMIFS can’t handle.
Excel SUMPRODUCT Function – Video Tutorial
Related Excel Functions:
- Excel AVERAGE Function.
- Excel AVERAGEIF Function.
- Excel AVERAGEIFS Function.
- Excel SUM Function.
- Excel SUMIF Function.
- Excel SUMIFS Function.
You May Also Like the Following Excel Tutorials:
I have to construct a formula to solve a problem that has contraints. Will you help me if I send you the excel
Ramesh
i have to add everyday some quantity in a particular cell say today its 50 tomorrow i have to add 50 in the same cell more,i should not write 100 and same way also minus the value. the balance should be in one different particular cell in a proper way.
Thanks a lot
I have a multiple range like 1to 100 ,100 to 200 in column in one sheet & find out single no. Which are in others sheet like 50 is first range & 150 is in second range
How does a formula like the following works ?
What is the meaning of * in this formula ?
=SUMPRODUCT((OFFSET($A8;0;1;1;372)””)*(OFFSET($A$3;0;1;1;372))*((OFFSET($A8;0;1;1;372))=NN$5))
* MEANING ALL
This is all need