## How to use the SUMPRODUCT function

*Article last updated on June 16, 2018*

The SUMPRODUCT function calculates the product of corresponding values and then returns the sum of each multiplication.

The picture above shows how the SUMPRODUCT works in greater detail.

### Excel Function Syntax

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

### Arguments

array1 |
Required. Required. The first array argument whose numbers you want to multiply and then sum. |

[array2] |
Required. Up to 254 additional arguments. |

### Example 1 - The basics

**Formula in cell B7:**

**Step 1 - Multiplying corresponding components in the given arrays**

The first array is in cell range B2:B4 and the second array is in cell range C2:C4.

B2:B4*C2:C4

becomes

{1;2;3} * {4;5;6}

becomes

{1*4; 2*5; 3*6}

and returns {4; 10; 18}. The same calculations are done in column D and shown in column E, see above picture.

**Step 2 - Return the sum of those products**

{4; 10; 18}

becomes

4 + 10 + 18

and returns 32 in cell B7. The same calculation is done E5, the sum of the products in cell range E2:E4 is calculated in cell E5. See above picture.

Now you know the basics. Let´s move on to something more interesting!

### Example 2 - Use a logical expression

**Formula in cell G4:**

**Step 1 - Multiplying corresponding components in the given arrays**

There is only one array in this formula but something else is distorting the picture. A comparison operator (equal sign) and a second cell value (G2) or a comparison value. With these we have now built a logical expression. This means that the value in cell G2 is compared to all the values in cell range B2:B6 (not case sensitive).

B2:B6=$G$2

becomes

{"Alaska";"California";"Arizona";"California";"Colorado"}="California"

and returns

{FALSE;TRUE;FALSE;TRUE;FALSE}.

They are all boolean values and excel can´t sum these values. We have to convert the values to numerical values. There are a few options, you can:

- Add a zero - (B2:B6=$G$2)+0
- Multiply with 1 - (B2:B6=$G$2)*1
- Double negative signs --(B2:B6=$G$2)

They all convert boolean values to numerical values.

--( {FALSE;TRUE;FALSE;TRUE;FALSE})

becomes

{0;1;0;1;0}

**Step 2 - Return the sum of those products**

{0;1;0;1;0}

becomes

0 + 1 + 0 + 1 + 0

and returns 2 in cell G4. There are two cells containing the value "California" in cell range B2:B6. You accomplish the same thing using the countif function or count multiple values in different columns using the countifs function. In fact, you can count entire records in a table.

#### Example 3 - Use multiple logical expressions

**Formula in cell D10:**

This formula contains three arrays, you can use up to 30 arrays. You can make the formula somewhat shorter:

This allows you to have a lot more expressions, if you like. It is only the available computer memory that is the limit. The formula looks like an array formula but don´t be fooled, you are not required to enter it as an array formula.

**Step 1 - Multiplying corresponding components in the given arrays**

(B2:B8=B10)*(C2:C8=C10)*D2:D8

becomes

({FALSE; TRUE; FALSE; TRUE; FALSE; TRUE; FALSE})*({FALSE; FALSE; FALSE; TRUE; FALSE; TRUE; FALSE})*{10; 20; 40; 10; 20; 30; 10}

becomes

{0;0;0;1;0;1;0}*{10; 20; 40; 10; 20; 30; 10}

and returns

{0; 0; 0; 10; 0; 30; 0}

**Step 2 - Return the sum of those products**

{0; 0; 0; 10; 0; 30; 0}

becomes

10 +30

and returns 40 in cell D10.

#### Example 4 - Use multiple logical expressions and mathematical operators

Mathematical operators between arrays allows you to do more complicated calculations, like this:

**Formula in cell D10:**

These expressions check if California is found in cell range B2:B8 or Las Vegas is found in cell range C2:C8. They are found in row 3, 5,7 and 8. The sumproduct function sums the corresponding values in column D and returns 70 in cell D10. 20+10+30+10 equals 70.

#### Download excel *.xlsx file

### Articles with the 'SUMPRODUCT' Function

The following 16 articles have formulas that contain the SUMPRODUCT function.

Formula for matching a date within a date range

Table of contents Match a date when a date range is entered in a single cell Match a date when […]

Identify overlapping date ranges

The formula in cell F6 returns TRUE if the date range on the same row overlaps another date range in […]

Overview This article describes how to create a random playlist of four teams total. Column A contains four teams. Each […]

Running totals within date range

Andrew asks: LOVE this example, my issue/need is, I need to add the results. So instead of States and Names, […]

Dynamic team generator in excel

Mark G asks: 1 - I see you could change the formula to have the experssion COUNTIF($C$1:C1, $E$2:$E$5)<5 changed so […]

Find empty cells and sum cells above

Is it possible to quickly select all empty cells and then sum cells above to next empty cell? Can I have […]

Katie asks: I have 57 sheets many of which are linked together by formulas, I need to get numbers from […]

The above image demonstrates how to ignore blank cells in a SUMPRODUCT formula. The following formula is shown in cell E3. […]

If cell contains multiple values

The array formula in cell C3 checks if text string in B3 contains all values in F2:F3. Related articles If […]

### Functions in 'Math and trigonometry'

The SUMPRODUCT function function is one of many functions in the 'Math and trigonometry' category.

Converts negative numbers to positive numbers, in other words, the ABS function removes the sign. Excel Function Syntax ABS(number) Arguments […]

The ACOS function calculates the arccosine, or inverse cosine, of a number. Formula in cell C3: =ACOS(B3) Excel Function Syntax […]

The ACOSH function calculates the inverse hyperbolic cosine of a number. Formula in cell C3: =ACOSH(B3) Excel Function Syntax ACOSH(number) […]

The ACOT function calculates the inverse cotangent of a number. The returned angle is given in radians from 0 (zero) […]

The ACOTH function calculates the inverse hyperbolic cotangent of a number. Formula in cell C3: =ACOTH(B3) Excel Function Syntax ACOTH(number) […]

How to use the AGGREGATE function

The AGGREGATE function allows you to calculate different specific functions to a list or database. A special AGGREGATE function feature […]

The ASIN function calculates the arcsine of a number. The angle is in radians and is between -pi/2 to pi/2. =ASIN(B3) Excel […]

The ASINH function calculates the inverse hyperbolic sine of a number. =ASINH(B3) Excel Function Syntax ASINH(number) Arguments number Required. Any […]

The ATAN function calculates the arctangent of a number. The returned angle is in radians between -pi/2 to pi/2. =ATAN(B3) Excel […]

The ATAN2 function calculates the arctangent of an angle using specific x- and y-coordinates. The returned angle is in radians […]

The ATANH function calculates the inverse hyperbolic tangent of a number. =ATANH(B3) Excel Function Syntax ATANH(number) Arguments number Required. Must be […]

The BASE function converts a number into a text representation with a given radix (base). Formula in cell C3: =BASE(10, […]

How to use the CEILING function

The CEILING function rounds a number up to its nearest multiple. The number is rounded down if both the number […]

How to use the COMBIN function

The COMBIN function returns the number of combinations for a specific number of elements out of a larger number of […]

How to use the COMBINA function

The COMBINA function calculates the number of combinations for a given number of elements from a larger group of elements. Formula in […]

The COS function calculates the cosine of an angle. Formula in cell C3: =COS(B3) Excel Function Syntax COS(number) Arguments number […]

The COSH function calculates the hyperbolic cosine of a number. Formula in cell C3: =COSH(B3) Excel Function Syntax COSH(number) Arguments […]

The COT function calculates the cotangent of an angle specified in radians. Formula in cell C3: =COT(B3) Excel Function Syntax […]

How to use the DECIMAL function

The DECIMAL function converts a text representation of a number in a given base into a decimal number. Formula in […]

How to use the DEGREES function

The DEGREES function calculates degrees from radians. Formula in cell C3: =DEGREES(B3) Excel Function Syntax DEGREES(angle) Arguments angle Required. The […]

The EVEN function rounds a number up to the nearest even whole number. An even number is a number that […]

Returns e raised to the power of a number, e equals 2.71828182845904. Example, e^2 equals 7.389056099 Formula in cell C3: […]

The FACT function returns the factorial of a number. Formula in cell C3: =FACT(B3) Example, 3! = 3*2*1 = 6 […]

How to use the FACTDOUBLE function

The FACTDOUBLE returns the double factorial of a number. Formula in cell C3: =FACTDOUBLE(B3) Excel Function Syntax FACTDOUBLE(number) Arguments number […]

How to use the FLOOR.MATH function

The FLOOR.MATH function rounds a number down to the nearest integer or to the nearest multiple of significance. Formula in […]

Removes the decimal part from positive numbers and returns the whole number (integer) except negative values are rounded down to […]

The LCM function calculates the least common multiple. The least common multiple is the smallest positive integer that is a […]

The LN function calculates the natural logarithm of a number. Natural logarithms are based on the constant e. Formula in […]

The LOG function calculates the logarithm of a number to a specific base. Formula in cell C3: =LOG(10) Excel Function […]

How to use the MINVERSE function

The MINVERSE function calculates the inverse matrix for a given array. This function is useful for solving equations with multiple variables. […]

The MMULT function calculates the matrix product of two arrays, an array as the same number of rows as array1 and […]

The Mod function returns the remainder after a number is divided by divisor. The Mod function is short for the Modulo […]

How to use the MROUND function

The MROUND function calculates a number rounded to a given multiple. Formula in cell D3: =MROUND(B3,C3) Excel Function Syntax MROUND(number, […]

How to use the MULTINOMIAL function

The MULTINOMIAL function calculates the ratio of the factorial of a sum of values to the product of factorials. Formula […]

The MUNIT function calculates the identity matrix for a given dimension. Array formula in cell B2: =MUNIT(3) The formula above returns an […]

The PI function returns the number pi (¶). Formula in cell B3: =PI() Excel Function Syntax PI() Arguments PI function […]

The POWER function calculates a number raised to a power. Excel Function Syntax POWER(number, power) Arguments number Required. The number […]

How to use the PRODUCT function

The PRODUCT function returns the product of the numbers given in the argument. Formula in cell D3: =PRODUCT(B3:C3) Excel Function […]

How to use the RADIANS function

The RADIANS function converts degrees to radians. Formula in cell C3: =RADIANS(B3) Excel Function Syntax RADIANS(angle) Arguments angle Required. The […]

The RAND function calculates a random real number greater than or equal to 0 and less than 1. The function […]

How to use the RANDBETWEEN function

Returns a random whole number between the numbers you specify. This function is volatile meaning a new random number is […]

The SEC function calculates the secant of an angle. Formula in cell E3: =SEC(B3) Excel Function Syntax SEC(number) Arguments number […]

The SECH function calculates the hyperbolic secant of an angle. Formula in cell C3: =SECH(B3) Excel Function Syntax SECH(number) Arguments […]

How to use the SERIESSUM function

The SERIESSUM function calculates the sum of a power series based on the following formula: SERIESSUM(x, n, m, a) = […]

The SIGN function returns the sign of a number. 1 for a positiv number, 0 (zero) for a 0 (zero) […]

The SIN function calculates the sine of an angle. Formula in cell C3: =SIN(B3) Excel Function Syntax SIN(number) Arguments number […]

The SINH function calculates the hyperbolic sine of a number. Formula in cell C3: =SINH(B3) Excel Function Syntax SINH(number) Arguments […]

The SQRT function calculates the positive square root. Formula in cell C3: =SQRT(B3) Excel Function Syntax SQRT(number) Arguments number Required. […]

The SUM function in Excel allows you to add values, the function returns the sum in the cell it is […]

The SUMIF function sums values based on a condition. The condition can be applied to the values being summed or […]

How to use the SUMIFS function

The SUMIFS function in cell D11 adds numbers from column D based on criteria applied to column B and C. […]

How to use the SUMPRODUCT function

The SUMPRODUCT function calculates the product of corresponding values and then returns the sum of each multiplication.

The SUMSQ function calculates the sum of the squares of the arguments. Formula in cell D3: =SUMSQ(B3:B5) 2^2 = 4, […]

How to use the SUMX2MY2 function

The SUMX2MY2function calculates the sum of the difference of squares of corresponding values in two arrays. Formula in cell F3: […]

How to use the SUMX2PY2 function

The SUMX2PY2 function calculates the sum of the sum of squares of corresponding values in two arrays. The sum of […]

How to use the SUMXMY2 function

The SUMXMY2 function calculates the sum of squares of differences of corresponding values in two arrays. Formula in cell F3: […]

The TAN function calculates the tangent of an angle. Formula in cell C3: =TAN(B3) Excel Function Syntax TAN(number) Arguments number […]

The TANH function calculates the hyperbolic tangent of a number. Formula in cell C3: =TANH(B3) Excel Function Syntax TANH(number) Arguments number […]

The TRUNC function removes the fractional part of the number to an integer. Formula in cell C3: =TRUNC(B3) Excel Function […]

Learn how to use the SUBTOTAL function

The picture above shows row 4 and row 8 hidden, the SUM argument 9 sums all values in C3:C11 whereas […]

The quotient function returns the integer portion of a division. Example, 5/2 = 2.5. The integer is 2. Excel Function […]

### 3 Responses to “How to use the SUMPRODUCT function”

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Use the img tag, like this: <img src="Insert pic link here">

**Contact Oscar**

You can contact me through this contact form

Hi Oscar,

While reading this article "How to use excel SUMPRODUCT function" I detected what I think is a minor error.

In example 3 (The California-Los angeles example), you say that the formula transaltes to:

=({FALSE; TRUE; FALSE; TRUE; FALSE; TRUE; FALSE})*({FALSE; FALSE; FALSE; FALSE; FALSE; FALSE; TRUE})*{10; 20; 40; 10; 20; 30; 10}

but i think that the second set of boolean values is not correct and should be:

=({FALSE; TRUE; FALSE; TRUE; FALSE; TRUE; FALSE})*({FALSE; FALSE; FALSE; TRUE; FALSE; TRUE; FALSE})*{10; 20; 40; 10; 20; 30; 10}

Is that correct or I understood incorrectly?

Thanks in advance for your support with this blog.

Regards

Arturo

Arturo,

thanks!!

[…] SUMPRODUCT(array1, array2, ) Returns the sum of the products of the corresponding ranges or arrays […]