SUMPRODUCT in Excel: Multiply and Add in One Step
By ExcelReady TeamUpdated 6 min read
The short answer
SUMPRODUCT multiplies matching items in two or more ranges and adds up the results. =SUMPRODUCT(C2:C7,D2:D7) multiplies each quantity by its price and returns the total, with no helper column. It also handles conditions, such as =SUMPRODUCT((B2:B7="North")C2:C7D2:D7), and works in every version of Excel.
Key takeaways
- =SUMPRODUCT(C2:C7,D2:D7) multiplies row by row, then adds the products: one formula instead of a helper column.
- Every range must be the same size, or SUMPRODUCT returns #VALUE!.
- Add conditions by multiplying tests: (B2:B7="North")C2:C7D2:D7 keeps only the North rows.
- Convert TRUE/FALSE to 1/0 with -- or by multiplying, or Excel treats them as zero.
- For a simple conditional sum, SUMIFS is easier to read; use SUMPRODUCT when you need to multiply or test calculated values.
On this page+
SUMPRODUCT in Excel multiplies the items in two or more ranges row by row, then adds up all the results. It turns "quantity times price for every row, then total it" into one formula, with no helper column. This guide is for anyone who already knows SUM and wants the next step: you will use SUMPRODUCT for totals, for conditional sums and counts, and learn the two errors that catch most people.
What does SUMPRODUCT do in Excel?#
SUMPRODUCT multiplies each pair of matching values and returns the sum of those products. "Product" here is the maths word for the result of a multiplication.
=SUMPRODUCT(array1, [array2], [array3], ...)| Argument | What it means |
|---|---|
array1 | The first range of numbers, such as quantities |
array2, ... | Optional further ranges of the same size, such as prices |
With one range, SUMPRODUCT simply adds it up, like SUM. With two or more, it multiplies the first item of each range, then the second items, and so on, and adds all those results. It works in every version of Excel, on Windows, Mac and the web, and you never need Ctrl+Shift+Enter.
How to use SUMPRODUCT: total revenue in one formula#
The classic use is revenue from a quantity column and a price column. Here is a small order list:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Region | Qty | Price |
| 2 | Notebook | North | 12 | 4.50 |
| 3 | Desk lamp | South | 3 | 24.00 |
| 4 | Stapler | North | 5 | 8.00 |
| 5 | Notebook | South | 20 | 4.50 |
| 6 | Office chair | North | 2 | 149.00 |
| 7 | Desk lamp | North | 4 | 24.00 |
Without SUMPRODUCT, you would add a column E with =C2*D2, fill it down, then use =SUM(E2:E7). With SUMPRODUCT it is one cell:
=SUMPRODUCT(C2:C7,D2:D7)Excel works out 12×4.5 + 3×24 + 5×8 + 20×4.5 + 2×149 + 4×24 = 54 + 72 + 40 + 90 + 298 + 96. The result is 650.
If you are new to writing formulas, our guide to writing your first Excel formula covers the basics of =, cell references and Enter.
How to add a condition to SUMPRODUCT#
You add a condition by putting a test in brackets and multiplying it with the other ranges. A test such as B2:B7="North" gives TRUE or FALSE for each row. When you multiply, Excel turns TRUE into 1 and FALSE into 0, so rows that fail the test become zero.
=SUMPRODUCT((B2:B7="North")*C2:C7*D2:D7)This returns 488, the revenue from North only (54 + 40 + 298 + 96). Two conditions work the same way:
=SUMPRODUCT((B2:B7="North")*(A2:A7="Desk lamp")*C2:C7)That returns 4, the number of desk lamps sold in the North. Each extra test in brackets is another AND condition: a row counts only if every test is TRUE.
SUMPRODUCT can also test values that SUMIFS can't, because it accepts calculations on the range. For example, =SUMPRODUCT((LEFT(A2:A7,4)="Desk")*C2:C7) adds the quantity of every product whose name starts with "Desk", returning 7.
How to count with SUMPRODUCT#
To count rows that pass a test, convert the TRUE/FALSE results into numbers and add them up. The double minus -- is the usual way: the first minus turns TRUE into -1, and the second turns it back into 1.
=SUMPRODUCT(--(B2:B7="North"))This returns 4, because four rows are North. For two conditions, multiply the tests: =SUMPRODUCT((B2:B7="North")*(C2:C7>=5)) counts North rows with 5 or more units and returns 2.
For plain counts, COUNTIFS is shorter. SUMPRODUCT is useful when COUNTIFS can't express the test, such as OR across different columns. See SUMIFS with OR logic for that pattern.
SUMPRODUCT vs SUMIFS: which should you use?#
Use SUMIFS for straightforward conditional sums, and SUMPRODUCT when you need to multiply or calculate inside the condition.
| Task | Better choice | Formula |
|---|---|---|
| Total Qty for North | SUMIFS | =SUMIFS(C2:C7,B2:B7,"North") |
| Revenue (Qty × Price) for North | SUMPRODUCT | =SUMPRODUCT((B2:B7="North")*C2:C7*D2:D7) |
| Qty where the name starts with "Desk" | Either | SUMIFS with "Desk*", or SUMPRODUCT with LEFT |
| Weighted average | SUMPRODUCT | =SUMPRODUCT(B2:B5,C2:C5)/SUM(C2:C5) |
SUMIFS can't multiply two columns, so "revenue by region" needs either a helper column or SUMPRODUCT. The same multiply-and-add idea gives you a weighted average in Excel, which is one of the most common SUMPRODUCT tasks in job tests.
Why does SUMPRODUCT return #VALUE! or a wrong total?#
Most SUMPRODUCT problems come from range sizes, text in the ranges, or TRUE/FALSE values that were never converted.
- Ranges of different sizes.
=SUMPRODUCT(C2:C7,D2:D6)returns #VALUE! because C2:C7 has six rows and D2:D6 has five. Every range must have the same number of rows and columns. - A header row inside a multiplied range.
=SUMPRODUCT(C1:C7*D1:D7)returns #VALUE!, because"Qty"*"Price"is text times text. With commas instead,=SUMPRODUCT(C1:C7,D1:D7)treats text as zero and still returns 650, but it is safer to start the ranges below the headers. - TRUE/FALSE passed as its own argument. In Excel,
=SUMPRODUCT((B2:B7="North"),C2:C7)returns 0, because SUMPRODUCT treats logical values in a separate argument as zero. Write--(B2:B7="North")or multiply the test with*instead. - Numbers stored as text. A quantity typed as text counts as zero with commas, or causes #VALUE! with
*. Look for the small green triangle in the cell.
Where SUMPRODUCT shows up at work#
SUMPRODUCT is a favourite in practical tests because it checks whether you understand ranges, not just one function. Typical tasks include order value from quantity and unit price, payroll cost from hours and hourly rate, and weighted scores in a performance review. Office and data roles use it often: see the Excel skills for admin jobs and the Excel skills for HR jobs for where it fits.
Two related tools are worth knowing next. MOD and INT for remainders and whole numbers pair well with SUMPRODUCT for "every nth row" tricks, and the SUMIFS function guide has the full reference for conditional sums.
Practise it#
Try the live exercise on this page: one SUMPRODUCT formula for total revenue. Then practise SUM and AutoSum in a live spreadsheet to make range selection automatic, and work through the COUNTIFS and SUMIFS lesson so you know when a conditional sum doesn't need SUMPRODUCT at all.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
In G2, use SUMPRODUCT to calculate the total revenue: multiply each Qty (C2:C7) by its Price (D2:D7) and add the results in one formula.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Price | Total revenue | ||||||
| 2 | ||||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 | ||||||||
| 10 |
Tip: Give SUMPRODUCT the two ranges, separated by a comma: the quantities first, then the prices.
Practise this in a lesson
Frequently asked questions
What does SUMPRODUCT do in Excel?
SUMPRODUCT multiplies the matching items in two or more ranges and returns the sum of those products. For example, =SUMPRODUCT(C2:C7,D2:D7) gives total revenue from a quantity column and a price column.
Why does SUMPRODUCT return #VALUE!?
Usually because the ranges are different sizes, such as C2:C7 and D2:D6. It can also happen when you multiply ranges with * and one of them includes a text header.
Do I need Ctrl+Shift+Enter for SUMPRODUCT?
No. SUMPRODUCT handles arrays on its own, so a normal Enter works in every version of Excel, including Excel 2010 and 2016.
Is SUMPRODUCT better than SUMIFS?
Not for simple conditional sums: SUMIFS is faster to write and easier to read. SUMPRODUCT wins when you need to multiply columns, use OR logic, or test a calculated value such as LEFT(A2:A7,4).
Can SUMPRODUCT count rows?
Yes. =SUMPRODUCT(--(B2:B7="North")) counts the rows where the test is TRUE, because -- turns TRUE into 1 and FALSE into 0.