SUMPRODUCT multiplies matching values in two or more ranges together, then adds up all those products in a single formula. The simplest version is =SUMPRODUCT(A2:A10,B2:B10), which computes A2×B2 + A3×B3 and so on, all the way down to A10×B10. What makes it genuinely useful is that you can drop comparison expressions inside it, so it also works as a conditional sum that doesn't require SUMIFS, helper columns or array entry. Nothing has to be installed or enabled: SUMPRODUCT is a built-in function that works in Google Sheets on the web, in the Android app and in the iOS app. It also exists in Excel, so formulas you build this way usually transfer, with the caveat that older Excel versions need array entry for some patterns where Sheets does not.
What You'll Need
- A Google account with access to Google Sheets (sheets.google.com, or the Google Sheets app).
- A spreadsheet with your data laid out in columns, with a header row and consistent data types (numbers in numeric columns, dates as real dates).
- A basic grasp of cell references such as
A2:A10and of comparison operators:=,<>(not equal),>,<. - Ideally, three columns: one or more criteria columns (for example a product name and a month) and one numeric column you want to total.
Step-by-Step
- Get a clean data layout first. Put your labels in row 1 and data starting in row 2. Don't leave a totals row in the middle of the range, and don't mix text such as "N/A" into the numeric column, because SUMPRODUCT treats text as zero in some positions and as an error in others. If your criteria column contains trailing spaces, clean them up (Data > Trim whitespace is one option in the web app) before building the formula. Labels can differ slightly by version and language, so look for the equivalent if yours differs.
- Start with the plain multiplication. Click an empty cell and type
=SUMPRODUCT(, then select your first range, type a comma, and select the second range. Close the bracket and press Enter. For example=SUMPRODUCT(C2:C11,D2:D11)multiplies each row's quantity by its unit price and totals them. The two ranges must be the same size and shape, or the formula returns#VALUE!. - Check the result against a quick manual sum. Add a helper column (
=C2*D2filled down) and total it with SUM. If both figures match, your ranges are aligned. If they don't, one range is offset by a row, which is the single most common SUMPRODUCT bug. - Add one criterion as a true/false test. Instead of a range, type a comparison that returns TRUE/FALSE for each row, then multiply it by your values. For example, to total sales only for "Coffee":
=SUMPRODUCT((A2:A11="Coffee")*D2:D11). The comparison produces an array of TRUE/FALSE values, TRUE counts as 1 and FALSE as 0, so only matching rows contribute. - Add a second criterion by multiplying another test. Multiplication acts as AND:
=SUMPRODUCT((A2:A11="Coffee")*(B2:B11="January")*D2:D11)totals Coffee in January only. Each additional condition is one more bracketed comparison joined with*. There is no practical limit worth worrying about for normal sheets. - Use OR logic where you need it. Addition acts as OR:
=SUMPRODUCT(((A2:A11="Coffee")+(A2:A11="Tea"))*D2:D11). Wrap the whole OR group in its own brackets so it is evaluated before the final multiplication, otherwise the arithmetic goes wrong. - Handle numbers and dates in criteria. For a numeric test, write
(C2:C11>100). For dates, write(B2:B11>=DATE(2024,1,1))rather than a hard-coded text date, because locale formats differ. If your criterion is in a cell, reference it instead of typing it:(A2:A11=F1)lets you change the filter without editing the formula. - Test with a small copy. Before trusting the answer, point the formula at three or four rows in a scratch sheet containing known values and check it by hand. This catches parentheses mistakes and mis-signed conditions in seconds.
- Copy it correctly. If you plan to drag the formula down or across, decide whether ranges should be locked.
A2:A11shifts as you copy;$A$2:$A$11stays put. Mix them (for example$A2$2:$A$11) when a criterion cell should move but the data range should not. - Watch the recalculation cost. SUMPRODUCT on whole columns such as
A2:Aforces Sheets to evaluate every row. Keep ranges tight, or bound them generously but finitely, if the sheet is slow.
Common Mistakes
- Unequal range sizes.
SUMPRODUCT(A2:A10,B2:B11)returns#VALUE!. Count the rows. - Missing brackets around a condition.
SUMPRODUCT(A2:A11="Coffee"*D2:D11)does not do what you think. Each test must be wrapped in its own pair of parentheses. - Using
,where*is needed. Commas and multiplication both work for straight numeric ranges, but when a criterion is involved, a comma between TRUE/FALSE and numbers behaves differently from multiplication in some versions. Use*consistently inside conditional formulas. - Numbers stored as text. If a "quantity" column shows a green triangle or left-aligns, SUMPRODUCT may treat entries as zero. Convert with the number format menu or VALUE.
- Hard-coded date strings. Text like "1/1/2024" fails when the sheet's locale expects a different order. Use DATE().
- Ranges that include the header row. A header such as "Qty" in a numeric range returns an error or gets counted as zero. Start at row 2.
Tips
- SUMPRODUCT is the classic way to count with two criteria:
=SUMPRODUCT((A2:A11="Coffee")*(B2:B11="January"))returns a count without a values column. - For weighted averages, divide the SUMPRODUCT by the sum of the weights:
=SUMPRODUCT(C2:C11,D2:D11)/SUM(D2:D11). - For most two- or three-criterion sums over a single column, SUMIFS is simpler and faster to read:
=SUMIFS(D2:D11,A2:A11,"Coffee",B2:B11,"January"). Reach for SUMPRODUCT when you need OR logic, weighted maths, or conditions across arrays that SUMIFS cannot handle. - If you keep getting 0 rather than an error, the criteria probably don't match exactly — check for trailing spaces, case differences in your expectation, and criteria typed as text versus numbers.
- Filtered rows are still included; SUMPRODUCT does not respect the filter view. Add a hidden helper column that records visibility if you must exclude filtered rows.
Troubleshooting
#VALUE! Almost always unequal range sizes or text inside a numeric range. Check that every range starts and ends on the same rows.
#N/A or #DIV/0! Appears when you divide SUMPRODUCT output by a SUM that is zero, or when a referenced cell is empty in a way your formula doesn't guard against. Wrap the divisor in IFERROR.
Result is 0 when you expect a total. Test each condition on its own: enter =SUMPRODUCT((A2:A11="Coffee")*1) in a spare cell and see whether it returns a plausible count. If it returns 0, the criterion text doesn't match — check spelling, spaces and whether the cell contains a number stored as text.
Result is off by one row's worth. Your ranges are misaligned; one starts at row 2 and another at row 3. Use the helper-column check from step 3.
The formula is slow on a large sheet. Replace whole-column ranges with bounded ranges, and consider whether SUMIFS would do the job.
If that did not work, rebuild the formula from the inside out: put the bracket group alone in a cell, confirm it produces TRUE/FALSE, then multiply by the numeric range. If you still can't isolate it, copy the sheet to a test tab and remove conditions one at a time until the figures match a hand count.
Frequently Asked Questions
Does SUMPRODUCT work without pressing Ctrl+Shift+Enter?
Yes. In Google Sheets SUMPRODUCT handles arrays natively, so a single Enter is enough. Older desktop Excel versions sometimes required array entry for similar formulas.
Can I use SUMPRODUCT with text values instead of numbers?
No. Text is treated as zero in the numeric ranges, and text inside a range used for multiplication usually produces #VALUE!. It only works as criteria (comparisons producing TRUE/FALSE).
What is the difference between SUMPRODUCT and SUMPRODUCT with a condition?
Plain SUMPRODUCT multiplies and adds matching positions across ranges. Adding bracket tests multiplies those TRUE/FALSE values into the products, which zeroes out non-matching rows — effectively a filtered sum.
Can SUMPRODUCT look at more than two ranges?
Yes. Add more ranges separated by commas (or more bracketed conditions joined with *), as long as every range has the same dimensions.
Why does my SUMPRODUCT return a decimal when I expect a whole number?
Because it multiplies — prices, percentages and fractions naturally produce decimals. Format the cell as a number or currency; don't wrap in ROUND unless you actually want to change the stored value.
Does SUMPRODUCT update when I change the filter?
No. Hidden and filtered-out rows still count. If you need to exclude them, add a helper column or use SUBTOTAL-based approaches instead.