Math & trig function

SUMPRODUCT function

Multiplies matching items in arrays and adds the results; also the classic way to sum or count with complex conditions.

Available in All versions of Excel, Excel for the web, Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

SUMPRODUCT(array1, [array2], [array3], ...)
ArgumentWhat it means
array1RequiredThe first range or array. With only one array, SUMPRODUCT simply adds its items.
array2, ...OptionalUp to 254 more arrays with exactly the same dimensions. Items in the same position are multiplied together.

Returns: One number: the sum of the products of corresponding items.

How SUMPRODUCT works

SUMPRODUCT takes two or more ranges of the same size, multiplies them row by row and adds up the results. The everyday use is an order total: quantities times unit prices, added together, without a helper column of line totals. It is equally handy for weighted averages, where each score is multiplied by its weight.

Its second life is conditional maths. A comparison such as (A2:A7="East") produces an array of TRUE/FALSE values; multiplying it by numbers turns TRUE into 1 and FALSE into 0, so only matching rows survive. Because SUMPRODUCT handles arrays natively, this worked even in old Excel versions without Ctrl+Shift+Enter, and it allows conditions that SUMIFS cannot express, like OR logic, calculations on the data (C2:C7*D2:D7>100) or functions applied to each cell (MONTH(A2:A7)=3).

Text and empty cells inside the arrays are treated as zero when they are separate arguments. Arrays of different sizes return #VALUE!. When you pass conditions as separate arguments, convert TRUE/FALSE to numbers with a double minus (--(A2:A7="East")), otherwise they count as zero.

Examples

1Order total without helper columns

C6fx=SUMPRODUCT(B2:B5, C2:C5)
ABC
1ItemQtyUnit price
2Paper (box)1224.5
3Toner389.9
4Stapler57.25
5Folders (pack)203.4
6667.95

Result: 667.95

12×24.50 + 3×89.90 + 5×7.25 + 20×3.40 = 294 + 269.70 + 36.25 + 68 = 667.95 (shown with 2 decimals).

2Revenue for one region

E2fx=SUMPRODUCT((A2:A7="East")*B2:B7*C2:C7)
ABCDE
1RegionQtyPrice
2East1015380
3West815
4East522
5North722
6East340
7West640

Result: 380

The test returns 1 for East rows and 0 for others, so only 10×15 + 5×22 + 3×40 = 150 + 110 + 120 are added.

3Weighted course grade

C6fx=SUMPRODUCT(B2:B5, C2:C5)/SUM(C2:C5)
ABC
1AssessmentScoreWeight
2Homework880.2
3Midterm740.3
4Project920.15
5Final exam810.35
681.95

Result: 81.95

Each score is multiplied by its weight: 17.6 + 22.2 + 13.8 + 28.35 = 81.95. The weights add up to 1, so the weighted grade is 81.95 (2 decimals). Dividing by SUM of weights keeps it correct even if weights do not total 100%.

4Count rows that meet a calculated condition

E3fx=SUMPRODUCT(--(A2:A7="East"), --(B2:B7*C2:C7>100))
ABCDE
1RegionQtyPrice
2East1015
3West8153
4East522
5North722
6East340
7West640

Result: 3

East rows have line values 150, 110 and 120, all above 100, so the count is 3. -- turns TRUE/FALSE into 1/0. COUNTIFS cannot test a product of two columns.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 19 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!The arrays have different sizes, e.g. B2:B7 and C2:C8.Make every range cover the same rows and columns.
Result is 0Conditions were passed as separate arguments without --, so TRUE/FALSE counted as 0.Use --(test) or multiply the conditions inside one argument.
#VALUE! with textText multiplied inside one argument, e.g. B2:B7*C2:C7 where a cell holds "n/a".Pass ranges as separate arguments (text then counts as 0) or clean the data.

Tips

  • Keep ranges to the real data instead of whole columns: SUMPRODUCT calculates every cell, so A:A means a million rows.
  • OR conditions: add the tests, ((A2:A7="East")+(A2:A7="West")), but wrap in --(...>0) if both could be true.
  • Use SUMPRODUCT(--(MONTH(A2:A100)=3), C2:C100) to total one month across several years.
  • In Microsoft 365, =SUM(B2:B5*C2:C5) does the same job because every formula handles arrays.

Questions

Do I need Ctrl+Shift+Enter with SUMPRODUCT?

No. SUMPRODUCT always evaluates arrays, which is why it was popular for conditional sums long before dynamic arrays.

SUMPRODUCT or SUMIFS?

Use SUMIFS for simple equal/greater-than conditions on large data because it is faster. Use SUMPRODUCT when the condition needs a calculation, a function on each cell, or OR logic.

Google Sheets

SUMPRODUCT also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

SUMPRODUCT in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechSOUČIN.SKALÁRNÍ
DanishSUMPRODUKT
DutchSOMPRODUCT
FinnishTULOJEN.SUMMA
FrenchSOMMEPROD
GermanSUMMENPRODUKT
HungarianSZORZATÖSSZEG
ItalianMATR.SOMMA.PRODOTTO
Norwegian (Bokmål)SUMMERPRODUKT
PolishSUMA.ILOCZYNÓW
Portuguese (Brazil)SOMARPRODUTO
Portuguese (Portugal)SOMARPRODUTO
RussianСУММПРОИЗВ
SpanishSUMAPRODUCTO
SwedishPRODUKTSUMMA
TurkishTOPLA.ÇARPIM

Recipes that use SUMPRODUCT