Start free
Math & conditional sums

SUMPRODUCT function

SUMPRODUCT multiplies the values on each row of two or more ranges and adds up the results. With tests such as (A2:A7="North") inside, it sums or counts only the rows that pass, in any version of Excel.

Available in every version of Excel, Excel for the web and Google Sheets

Key takeaways

  • SUMPRODUCT multiplies ranges row by row and adds the products: =SUMPRODUCT(B2:B5,C2:C5) is B2*C2 + B3*C3 and so on.
  • A test such as (A2:A7="North") gives TRUE or FALSE on each row. Multiply it by a range, or put -- in front, so Excel counts it as one or zero.
  • Every range must be the same size, or the result is #VALUE!.
  • For plain conditions SUMIFS and COUNTIFS are simpler. Reach for SUMPRODUCT when you need to multiply columns, or to test a calculation on each cell, such as the month of a date.
On this page

SUMPRODUCT syntax

=SUMPRODUCT(array1, [array2], [array3], ...)
ArgumentRequiredWhat it means
array1YesThe first range or array. Given only this one, SUMPRODUCT adds it up.
array2, array3 …NoMore ranges, each the same size as array1. The values on each row are multiplied together, then the products are added. Up to 255 arrays in all.

Examples

Order total: quantity times price

Each item's quantity times its price, added up, in one formula. Without SUMPRODUCT you'd need a line-total column and a SUM under it.

E2=SUMPRODUCT(B2:B5,C2:C5)
RowABCDE
1ItemQtyPriceOrder total
2Notebook12$3.50$137.00
3Pen40$1.20
4Folder25$0.80
5Stapler3$9.00
=SUMPRODUCT(B2:B5,C2:C5) → $137.00

Revenue for one region

(A2:A7=E2) is TRUE on the North rows and FALSE on the others. Multiplying turns TRUE into one and FALSE into zero, so only the North rows' units times price are added.

F2=SUMPRODUCT((A2:A7=E2)*B2:B7*C2:C7)
RowABCDEF
1RegionUnitsPriceRegionRevenue
2North20$15North$580
3South35$12
4North10$18
5East25$15
6North5$20
7South15$12
=SUMPRODUCT((A2:A7=E2)*B2:B7*C2:C7) → $580

Count the rows that pass two tests

Two tests multiplied together give one only on a row that passes both, so adding them up counts those rows: East orders above 500. COUNTIFS does the same job here; SUMPRODUCT's way also works when a test needs a calculation.

E2=SUMPRODUCT((B2:B6="East")*(C2:C6>500))
RowABCDE
1OrderRegionAmountEast over 500
2A-1East7502
3A-2West1,200
4A-3East300
5A-4East980
6A-5West450
=SUMPRODUCT((B2:B6="East")*(C2:C6>500)) → 2

Total one month, which SUMIFS can't do directly

MONTH(A2:A6) works out the month of every date, and the test keeps the ones equal to D2. SUMIFS can only compare the cells as they are, not the month inside them. All the dates here are in 2026; for dates across years, add a YEAR test too.

E2=SUMPRODUCT((MONTH(A2:A6)=D2)*B2:B6)
RowABCDE
1DateAmountMonthTotal
211 Feb 20264203775
32 Mar 2026310
419 Mar 2026275
57 Apr 2026500
628 Mar 2026190
=SUMPRODUCT((MONTH(A2:A6)=D2)*B2:B6) → 775

Practise it

New data, so you can't copy the answer above. We check the number your formula returns, then change the data to make sure it still holds.

Your task: In E2, work out the course grade: each score in B2:B5 counts for the weight beside it in C2:C5.

Graded live
RowABCDE
1PartScoreWeightGrade
2Quizzes8220%
3Project7430%
4Midterm6820%
5Final exam9130%

Write the formula in the bar above, then press Check or Enter.

Hint

SUMPRODUCT takes the scores and the weights as two ranges, B2:B5 and C2:C5, multiplies them row by row and adds the results.

Solution

=SUMPRODUCT(B2:B5,C2:C5) Any formula that returns the same result passes.

Common mistakes

  1. Ranges of different sizes. B2:B7 and C2:C6 don't line up, so SUMPRODUCT returns #VALUE!. Make every range start and end on the same rows.
  2. A test on its own counts nothing. SUMPRODUCT counts text and blanks as zero, and TRUE and FALSE too, so =SUMPRODUCT(B2:B6="East") returns 0 in Excel. Multiply the test by another range or test, or put two minus signs in front of it: =SUMPRODUCT(--(B2:B6="East")) counts the East rows.
  3. Adding two tests for OR when a row can pass both. Adding tests means "either", but a row that passes both gets counted twice. Test the sum instead: =SUMPRODUCT(((B2:B6="East")+(C2:C6>500)>0)*C2:C6) adds each matching row once.
  4. Whole columns. =SUMPRODUCT(A:A,B:B) multiplies every one of the 1,048,576 rows in each column, which slows the workbook down. Use ranges that cover the data.

SUMPRODUCT or SUMIFS?

You need to… Use
Add one column for the rows that match a few conditions SUMIFS
Count the rows that match COUNTIFS
Multiply columns together, then add SUMPRODUCT
Test a calculation on each cell: its month, its length, part of its text SUMPRODUCT
Use “either” logic across different columns SUMPRODUCT

SUMIFS and COUNTIFS read more clearly and recalculate faster, so they’re the first choice when they can do the job. SUMPRODUCT covers the rest.

FAQ

What's the difference between SUMPRODUCT and SUMIFS?

SUMIFS adds one range for the rows that meet its conditions, and it is simpler and faster for that. SUMPRODUCT multiplies ranges, and its tests can work on a calculation of each cell, such as the month of a date or the length of a text, which SUMIFS can't.

What does -- do in SUMPRODUCT?

Two minus signs turn TRUE into one and FALSE into zero. SUMPRODUCT counts TRUE and FALSE as zero, so a test on its own needs the -- (or a multiplication) before it can be added up.

Do I need Ctrl+Shift+Enter for SUMPRODUCT?

No. SUMPRODUCT works with arrays in every version of Excel, so you enter it like any other formula. That's why it was the usual way to sum with conditions in older versions.

Can SUMPRODUCT count rows?

Yes. Give it only tests, multiplied together, and it adds up the rows that pass them all: =SUMPRODUCT((B2:B6="East")*(C2:C6>500)).

Guides that use SUMPRODUCT

Worked problems with practice sheets.

Interview prepPractice sheet

SUMIFS interview question: summarise sales by region

Turn a raw sales list into a summary by region and product, without a pivot table. The formula interviewers expect, the $ signs that make it copy, and a sheet that grades yours.

4 min read · Updated

Know SUMPRODUCT? Prove it on a real sheet.

Practise SUMPRODUCT and the functions around it in a live grid that grades your result and explains your mistakes.

Runs in your browser · Graded on your result · No install