Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SUMPRODUCT in Excel: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

SUMPRODUCT multiplies matching items in two or more arrays and adds the results — all in one formula. Its real power is that it can apply conditions without you having to enter an array formula with Ctrl+Shift+Enter, so it acts as a flexible conditional sum that works in every version of Excel, including older copies that lack SUMIFS or FILTER. Type =SUMPRODUCT(B2:B10,C2:C10) to multiply a quantity column by a price column and get the total, or add conditions inside it to total only the rows you care about.

What You'll Need

  • Excel on desktop (Windows or Mac) or Excel for the web. Every version supports SUMPRODUCT.
  • Two or more ranges of the same size — matching row counts and column counts — or the formula will return an error.
  • Numeric data in the ranges you plan to multiply. Text cells are treated as zero, which is useful for conditions but confusing when it happens by accident.
  • For conditional totals, a helper idea of what you are testing, for example "product equals Widget" or "region equals North".

Step-by-Step

  1. Lay out your data in a clean table. Put each field in its own column with a single header row and no blank rows inside the data. For example: column A for Product, B for Region, C for Quantity, D for Unit Price.
  2. Write the basic multiplication. Click an empty cell and type =SUMPRODUCT(C2:C10,D2:D10). This multiplies each quantity by its unit price row by row, then adds all ten results. Press Enter. You now have a weighted total without a helper column.
  3. Check the ranges line up. Both ranges must start and end on the same rows. C2:C10 with D2:D10 is fine; C2:C10 with D3:D11 is not — Excel returns #VALUE!.
  4. Add a single condition. To total only Widget sales, type =SUMPRODUCT((A2:A10="Widget")*C2:C10*D2:D10). The comparison in brackets produces TRUE or FALSE for each row; multiplying by the quantity and price forces those to 1 or 0, so only matching rows survive.
  5. Add a second condition with a comma trick or an asterisk. For Widgets sold in the North region: =SUMPRODUCT((A2:A10="Widget")*(B2:B10="North")*C2:C10*D2:D10). Each extra bracketed test is multiplied in. Every test must be the same size as the value ranges.
  6. Use cell references instead of typed values. Put "Widget" in F1 and "North" in F2, then reference them: =SUMPRODUCT((A2:A10=F1)*(B2:B10=F2)*C2:C10*D2:D10). Changing the cells updates the total instantly, which makes the formula reusable.
  7. Handle numeric conditions with double minus. For orders above 100 units, use =SUMPRODUCT(--(C2:C10>100),C2:C10,D2:D10). The double unary converts TRUE/FALSE to 1/0 so the other arrays multiply cleanly. You can also write -- in front of every bracket instead of joining them with *.
  8. Add a date range. To total between two dates held in H1 and H2: =SUMPRODUCT((E2:E10>=H1)*(E2:E10<=H2)*C2:C10*D2:D10). Dates compare correctly as long as the cells really contain dates, not text that looks like dates.
  9. Copy the formula down or across safely. If you plan to fill the formula into other cells, lock the ranges with dollar signs: $A$2:$A$10, $C$2:$C$10, and so on. Unlocked ranges shift as you drag and silently produce wrong totals.
  10. Verify against a known figure. Filter the data to one condition, select the quantity and price columns, and compare Excel's status-bar sum of the products with your SUMPRODUCT result. A mismatch almost always means a range size problem or a stray text value.

Common Mistakes

Unequal range sizes. This is the number-one cause of #VALUE!. Every array inside SUMPRODUCT must have the same number of rows and columns. Count them rather than assuming.

Whole-column references. Something like A:A multiplied by C:C works but is slow on large sheets and often drags the header or a text cell into the calculation. Use bounded ranges instead.

Missing the double minus. When you join arrays with commas rather than asterisks, TRUE/FALSE will not multiply. Use -- in front of each condition, or switch to the asterisk syntax.

Text in numeric columns. A number stored as text is treated as zero, so a row quietly disappears from the total. Watch for green error triangles or left-aligned numbers and convert them with Data > Text to Columns, or multiply by 1.

Forgetting that commas and asterisks behave differently. Commas separate arrays and require numeric values; asterisks multiply arrays and coerce TRUE/FALSE automatically. Mixing the two carelessly gives unexpected results.

Hard-coded criteria that never change. Typing "Widget" directly into the formula means editing it every time. Point at a cell instead.

Tips

  • Use SUMPRODUCT when you need to sum a calculation (quantity times price), not just a column. SUMIFS can only sum an existing column; SUMPRODUCT can multiply first and conditionally add.
  • Wrap criteria in a single set of brackets and keep every bracket the same size as your data range.
  • For an either/or test, use addition inside brackets: ((A2:A10="Widget")+(A2:A10="Gadget")>0) counts rows matching either name.
  • Use LEN or wildcards sparingly — SUMPRODUCT does not support text wildcards like SUMIFS does with *, so "begins with" tests need functions such as LEFT.
  • Name your ranges (Formulas > Define Name) so a long formula reads like =SUMPRODUCT((Product="Widget")*Qty*Price).
  • Use Excel's Evaluate Formula tool (Formulas tab) to step through SUMPRODUCT one array at a time when a total looks wrong.

Troubleshooting

#VALUE! error. Check that every range is the same size and that none contains text where a number is expected. Trim blank rows and stray notes from the bottom of your ranges.

Result is zero. Either the criteria match nothing, or the criteria cells are text while the data is numeric (or vice versa). Test a single condition on its own first with =SUMPRODUCT(--(A2:A10="Widget")), which counts matching rows. If that returns zero, the problem is the match, not the maths.

Result is far too high. A range is probably offset by one row, so values are pairing with the wrong rows. Rebuild the formula from scratch and click each range rather than typing it.

#N/A or #DIV/0! appearing. A referenced cell holds an error or a formula returning one, and SUMPRODUCT propagates it. Fix the source cell first.

Formula is painfully slow. Whole-column references or thousands of conditions will crawl. Limit ranges to the actual data or move to SUMIFS, which is optimised for simple conditional sums.

If that did not work, delete the formula, retype it manually with small test ranges of two or three rows, and confirm the logic works before scaling it up. Label differences in menus can vary slightly by Excel version, device and region.

Frequently Asked Questions

What is the difference between SUMPRODUCT and SUMIFS?

SUMIFS adds up values already sitting in one column. SUMPRODUCT multiplies across columns first, so it can total quantity times price with conditions applied — something SUMIFS cannot do without a helper column.

Why do I need the double minus in SUMPRODUCT?

Comparisons return TRUE or FALSE, which the comma syntax will not calculate. The -- converts them to 1 and 0 so they can be multiplied and summed.

Does SUMPRODUCT work with text criteria?

Yes, using equality or comparison in brackets, such as (B2:B10="North"). It does not support the * and ? wildcards the same way SUMIFS does.

Can I use SUMPRODUCT across multiple sheets?

Yes, provided each referenced range on the other sheet is the same size. Reference it as Sheet2!C2:C10.

Is SUMPRODUCT available in Excel for the web and older versions?

Yes. It is one of the oldest functions in Excel and works in every desktop version and in Excel for the web, which is why it is popular as a fallback for dynamic array functions.

Do I need to press Ctrl+Shift+Enter?

No. SUMPRODUCT handles arrays natively, so a plain Enter is enough in all versions.