Sumproduct() Function

The Excel Sumproduct function returns the sum of the products of corresponding ranges or arrays. But this function is capable of much more than its definition.

 

Syntax

The syntax for the Sumproduct function in Microsoft Excel is:

SUMPRODUCT( array1, [array2, ... array_n] )

Parameters or Arguments

array1, array2, … array_n

The ranges of cells or arrays that you wish to multiply. All arrays must have the same number of rows and columns. You must enter at least 2 arrays and you can have up to 30 arrays.

Excel Sumproduct Formula Examples:

If you have a table as shown in the below image:

Now if you want to apply Sumproduct formula on these values then your formula should be: =SUMPRODUCT(C2:C11,D2:D11)

This will give you an output = 935. So, internally Sumproduct has multiplied each element of both the arrays and then added it to one another.

Example: (1×11)+(2×12)+(3×13)+(4×14)+(5×15)+(6×16)+(7×17)+(8×18)+(9×19)+(10×20) = 935

Sumproduct Function by Changing Arithmetic Operators:

This is another good thing about the Sumproduct formula. Sumproduct can also be used with user defined mathematical operators instead of the default multiplication operation. An example will make this clear:

Multiplication Sumproduct

Writing a Multiplication Sumproduct function as: =SUMPRODUCT(C2:C11*D2:D11) “Replaced comma with multiplication sign”

This makes sense as it tells excel to use the multiplication operator between the corresponding array elements and then add them up (same as Example 1). So it will also yield 935 in the case of above example.

This is the same thing that you can achieve with the formula: =Sumproduct(C2:C11,D2:D11)

Division Sumproduct

A Division Sumproduct can be used as:=SUMPRODUCT(C2:C11/D2:D11)

In the context of above example it will we implemented as: (1÷11)+(2÷12)+(3÷13)+(4÷14)+(5÷15)+(6÷16)+(7÷17)+(8÷18)+(9÷19)+(10÷20)

And gives and output = 3.312285968

Addition Sumproduct

An Addition Sumproduct can be used as: =SUMPRODUCT(C2:C11+D2:D11)

And Microsoft Excel will implement it as:(1+11)+(2+12)+(3+13)+(4+14)+(5+15)+(6+16)+(7+17)+(8+18)+(9+19)+(10+20)

And the output will be: 210

Subtraction Sumproduct

Similarly a Subtraction Sumproduct can be used as: =SUMPRODUCT(C2:C11-D2:D11)

This will be implemented internally as:(1-11)+(2-12)+(3-13)+(4-14)+(5-15)+(6-16)+(7-17)+(8-18)+(9-19)+(10-20)

And will result into a value = -100

Using Criteria in Sumproduct Calculation:

Now comes the best part of using the Excel Sumproduct Function. Sumproduct formula can also be used in performing selective data operations based on a particular criterion.

For instance: You have a data set as shown in the above image. And you want to perform a Multiplication Sumproduct of two array ranges but only for the category named ‘Fibre’.

Then the formula should be as: =SUMPRODUCT((C2:C11*D2:D11)*(B2:B11=”Fibre”))

Excel will search the category ‘fibre’ in the defined range. And will only do the Sumproduct for the values of ‘fibre’ category like: (2×12)+(8×18) which gives the result 168.

Notes:

  • The array arguments must have the same dimensions. If they do not, Sumproduct returns the #VALUE! error value.
  • Up to 30 arrays can be supplied.
  • Sumproduct treats array entries that are not numeric as if they were zeros.
  • Sumproduct can return results from a closed external workbook.
  • Sumproduct generally is more powerful than SUMIFS.
  • Sumproduct can’t support wildcard characters.
  • If just one array is supplied, the function returns the sum of the values in that array.