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], ...)| Argument | What it means | |
|---|---|---|
array1 | Required | The first range or array. With only one array, SUMPRODUCT simply adds its items. |
array2, ... | Optional | Up 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
| A | B | C | |
|---|---|---|---|
| 1 | Item | Qty | Unit price |
| 2 | Paper (box) | 12 | 24.5 |
| 3 | Toner | 3 | 89.9 |
| 4 | Stapler | 5 | 7.25 |
| 5 | Folders (pack) | 20 | 3.4 |
| 6 | 667.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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Qty | Price | ||
| 2 | East | 10 | 15 | 380 | |
| 3 | West | 8 | 15 | ||
| 4 | East | 5 | 22 | ||
| 5 | North | 7 | 22 | ||
| 6 | East | 3 | 40 | ||
| 7 | West | 6 | 40 |
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
| A | B | C | |
|---|---|---|---|
| 1 | Assessment | Score | Weight |
| 2 | Homework | 88 | 0.2 |
| 3 | Midterm | 74 | 0.3 |
| 4 | Project | 92 | 0.15 |
| 5 | Final exam | 81 | 0.35 |
| 6 | 81.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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Qty | Price | ||
| 2 | East | 10 | 15 | ||
| 3 | West | 8 | 15 | 3 | |
| 4 | East | 5 | 22 | ||
| 5 | North | 7 | 22 | ||
| 6 | East | 3 | 40 | ||
| 7 | West | 6 | 40 |
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.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | The arrays have different sizes, e.g. B2:B7 and C2:C8. | Make every range cover the same rows and columns. |
Result is 0 | Conditions were passed as separate arguments without --, so TRUE/FALSE counted as 0. | Use --(test) or multiply the conditions inside one argument. |
#VALUE! with text | Text 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:Ameans 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.
| Language | Function name |
|---|---|
| Czech | SOUČIN.SKALÁRNÍ |
| Danish | SUMPRODUKT |
| Dutch | SOMPRODUCT |
| Finnish | TULOJEN.SUMMA |
| French | SOMMEPROD |
| German | SUMMENPRODUKT |
| Hungarian | SZORZATÖSSZEG |
| Italian | MATR.SOMMA.PRODOTTO |
| Norwegian (Bokmål) | SUMMERPRODUKT |
| Polish | SUMA.ILOCZYNÓW |
| Portuguese (Brazil) | SOMARPRODUTO |
| Portuguese (Portugal) | SOMARPRODUTO |
| Russian | СУММПРОИЗВ |
| Spanish | SUMAPRODUCTO |
| Swedish | PRODUKTSUMMA |
| Turkish | TOPLA.ÇARPIM |
Recipes that use SUMPRODUCT
- How to calculate a weighted average in Excel
- How to compare two columns in Excel
- How to count cells that contain text in Excel
- How to count distinct values with criteria in Excel
- How to count unique values in Excel
- How to do a case-sensitive lookup in Excel
- How to rank numbers with ties in Excel
- How to shade alternate rows in Excel