SUMPRODUCT With Criteria: Excel Formula How-To
In this article
SUMPRODUCT with criteria lets you multiply matching values across two or more ranges and add the results in a single formula, without adding a helper column. The classic pattern is =SUMPRODUCT((A2:A100="North")*(B2:B100)), which treats each condition as a TRUE/FALSE test, converts it to 1 or 0, and then multiplies by the values you want totalled. It works in every modern version of Excel, including Excel for the web, Microsoft 365, Excel 2019 and earlier versions on Windows and Mac, and it does not need to be entered as an array formula with Ctrl+Shift+Enter.
The reason people reach for SUMPRODUCT is that it handles a job SUMIFS cannot: comparing two arrays against each other row by row. If you want to multiply price by quantity only for rows where a flag is set, or match two lists of names position by position, SUMPRODUCT does it in one cell. A note on the rest of this guide: Excel menu and function names are consistent, but the exact ribbon labels you see can differ slightly by version, platform and region, so read the intent rather than the exact word.
What You'll Need
- A copy of Excel on Windows, Mac or the web. Google Sheets and LibreOffice Calc support the same formula structure, with minor syntax differences in separators.
- Data laid out in columns with a clear header row, ideally converted to a table for stability.
- Ranges of exactly the same height, or you will get a #VALUE! error.
- A scrap cell or a new column where you can test the formula before putting it on a live dashboard.
Step-by-Step
- Identify your ranges. Write down which column holds the criteria and which column holds the values to sum or multiply. For a sales sheet, that might be column C for Region and column E for Revenue, starting at row 2 down to row 500. Keep the row count identical: C2:C500 and E2:E500, not C2:C500 and E2:E600.
- Start with the simplest case: one condition that filters a sum. In an empty cell type
=SUMPRODUCT((C2:C500="North")*E2:E500)and press Enter. The comparison inside the first set of brackets produces an array of TRUE and FALSE values, one per row. Multiplying by E2:E500 coerces TRUE to 1 and FALSE to 0, so only North rows contribute revenue. - Add a second condition by multiplying another bracket pair. Extend to
=SUMPRODUCT((C2:C500="North")*(D2:D500="Q3")*E2:E500). Each added condition narrows the result because a row must score 1 on every test to survive the multiplication. Order of the brackets does not matter. - Replace a simple filter with a real multiplication. This is the pattern SUMIFS cannot replicate:
=SUMPRODUCT((C2:C500="North")*E2:E500*F2:F500)multiplies quantity in E by unit price in F for matching rows, then adds the products. If you only need the sum of one column against criteria, SUMIFS is still faster and easier to read; use SUMPRODUCT when you need the array multiplication. - Use commas for AND logic, asterisks for anything involving multiplication.
=SUMPRODUCT((A2:A100>10),(B2:B100<50))adds nothing but counts rows meeting both tests, which is a useful cross-check against COUNTIFS. Once you multiply by values, stick with asterisks throughout to avoid a #VALUE! mismatch. - Handle OR conditions with plus signs. To count or sum rows where the region is North or South, write
=SUMPRODUCT(((C2:C500="North")+(C2:C500="South"))>0, E2:E500). The>0guard is essential: without it, a row that somehow matched both tests would score 2 and get double-counted. For mutually exclusive text values the guard is harmless but good practice. - Add wildcards for partial matches. Use
=SUMPRODUCT((ISNUMBER(SEARCH("north",C2:C500)))*E2:E500)to match North, Northern and North-East. SEARCH is case-insensitive and returns a number or an error, and ISNUMBER turns that into TRUE/FALSE. For a case-sensitive partial match, use FIND instead. - Test against SUMIFS before you trust it. Build the same total with
=SUMIFS(E2:E500,C2:C500,"North")in a nearby cell. The two numbers should match exactly. If they do not, the most likely cause is a trailing space in the criteria column or values stored as text. - Convert the ranges to a structured table if you want it to grow. Select the data, use Insert > Table, then reference the table columns as
Table1[Region]andTable1[Revenue]. Formulas then expand automatically as rows are added, which beats editing range endpoints by hand. - Lock the ranges with absolute references before filling down. Press F4 on each range to add dollar signs, or convert to a table as above. Otherwise the ranges shift as you copy the formula down a summary column and the totals quietly drift.
- Round the result if it feeds a report. Wrap the whole formula in ROUND, giving
=ROUND(SUMPRODUCT(...),2), so floating-point artefacts such as 1234.5600000001 do not appear in exported figures.
Common Mistakes
- Unequal range sizes. This is the single most frequent cause of #VALUE! errors. Every range in the formula must span the same number of rows. Check the status bar count when you select each range.
- Forgetting the double unary or the multiplication.
=SUMPRODUCT((C2:C500="North"))with no value range returns a count of matching rows, not a sum of revenue. That is sometimes what you want, but it surprises people who expected a total. - Numbers stored as text. If revenue comes from an export, values may look numeric but be left-aligned text. SUMPRODUCT treats them as zero, so totals come out too low. Select the column, use Data > Text to Columns and click Finish, or multiply by 1 inside the formula.
- Full-column references. SUMPRODUCT evaluates every cell, so C:C references on a large sheet are slow. Limit ranges to the actual data rows.
- Missing the OR guard. Leaving out the
>0test in an OR formula can double-count rows that meet both conditions. - Assuming it is array-entered. SUMPRODUCT handles arrays natively, so adding Ctrl+Shift+Enter is unnecessary and can confuse later editors of the workbook.
Tips
- Press F9 while editing a portion of the formula to see the intermediate array result, then press Escape to return. This is the fastest way to spot stray spaces, text values or offset ranges.
- Keep criteria in cells rather than hard-coding them, so the formula reads
"="&G2and users can change the filter without editing formulas. - When counting rather than summing, SUMPRODUCT with conditions often replaces COUNTIFS because it supports arrays and complex logic in a single expression.
- Sort the source data logically first. It makes visual spot-checks against filtered subtotals quick and reliable.
- Document the formula in an adjacent comment cell; a long nested SUMPRODUCT is hard to read even for the person who built it.
Troubleshooting
#VALUE! error: Compare range sizes first. Then confirm no range contains merged cells. Then check that multiplying arrays of different dimensions has not crept in through a mis-typed row number.
#N/A error: Usually SEARCH or FIND is returning an error on a cell, often because the lookup column contains blanks or error values such as #N/A carried over from a VLOOKUP. Wrap the tested column in IFERROR or clean the source.
Total is zero when it should not be: The criteria text probably does not match exactly. Use TRIM to strip extra spaces, and remember SUMPRODUCT comparisons like ="North" are case-insensitive, so casing is not usually the issue. Check whether the values column is text.
Total is too high: Look for duplicate rows in the source, or a missing OR guard causing double counting. Cross-check with a filtered subtotal of the same data.
Formula is slow: Replace full-column references with bounded ranges, or switch to SUMIFS if no array multiplication is needed. SUMIFS is optimised and often several times faster.
If that did not work
Rebuild the formula in a fresh cell from the innermost bracket outwards, checking each piece with F9. If the workbook still behaves oddly, save a copy, then try the formula in a brand-new sheet with a small sample of the data. Recreating the file or resetting Excel is never necessary for a formula problem and risks losing unsaved work, so avoid it.
Frequently Asked Questions
Can SUMIFS do everything SUMPRODUCT can?
No. SUMIFS sums one column against criteria, but it cannot multiply two value columns together row by row, nor easily handle array comparisons between two lists. SUMPRODUCT covers both.
Do I need Ctrl+Shift+Enter?
No. SUMPRODUCT accepts arrays by design. Entering it as an array formula is unnecessary and generally adds nothing except confusion.
Is SUMPRODUCT case-sensitive for text criteria?
No. The simple comparison against text ignores case. To force case sensitivity, use EXACT inside the formula, for example =SUMPRODUCT(EXACT(C2:C500,"North")*E2:E500).
Can I use SUMPRODUCT with dates?
Yes. Compare against real date values rather than text, and combine conditions with asterisks: =SUMPRODUCT((B2:B500>=DATE(2026,1,1))*(B2:B500<=DATE(2026,3,31))*E2:E500).
Does it work in Excel for the web and Google Sheets?
Yes, the same syntax works. In locales that use semicolons as the argument separator, replace the commas accordingly.
Why does it ignore my blank criteria cells?
Blank cells fail an equality test against text, so they contribute zero. Test for blanks explicitly with (C2:C500="") if you need to include them.