To sum values in Excel based on two conditions, use SUMPRODUCT with multiplication: =SUMPRODUCT((range1=criteria1)*(range2=criteria2)*sum_range). This works in every modern Excel version without needing array entry. The key is that each condition produces TRUE/FALSE, multiplication turns them into 1/0, and the final range supplies the numbers to add. No special setup is required beyond having your data in columns and knowing which ranges hold your criteria and which holds the values to sum.

What You'll Need

  • Excel 2010 or later (desktop or Microsoft 365). The formula also works in Excel for the web.
  • Your data laid out in columns, with criteria ranges and the sum range all the same height (same number of rows).
  • Basic familiarity with cell references and the equals sign to start a formula.

Step-by-Step

  1. Identify your ranges. Suppose column A holds product names, column B holds regions, and column C holds sales amounts. You want to sum sales where product = "Widget" and region = "North". Your criteria ranges are A2:A100 and B2:B100; your sum range is C2:C100. All three must cover the same rows.
  2. Click the cell where you want the result and type =SUMPRODUCT(.
  3. Enter the first condition in parentheses: (A2:A100="Widget"). This returns an array of TRUE/FALSE values.
  4. Type an asterisk to multiply, then the second condition: (B2:B100="North"). The asterisk acts as AND — both conditions must be TRUE for the row to count.
  5. Type another asterisk and the sum range: C2:C100. Do not wrap the sum range in parentheses or add a condition to it.
  6. Close the parenthesis and press Enter. The full formula is =SUMPRODUCT((A2:A100="Widget")*(B2:B100="North")*C2:C100). Excel multiplies each row's TRUE/FALSE values (1 or 0) by the sales amount and adds the results.
  7. Verify the result by applying AutoFilter to your data, filtering for both criteria, and checking the sum in the status bar. If the numbers match, your formula is correct.
  8. Make criteria dynamic by referencing cells instead of hard-coded text. Put "Widget" in E1 and "North" in F1, then use =SUMPRODUCT((A2:A100=E1)*(B2:B100=F1)*C2:C100). Changing E1 or F1 updates the total instantly.

Note: menu labels and function behavior can differ slightly by Excel version and region, but SUMPRODUCT syntax is consistent across desktop, web, and Mac versions.

Common Mistakes

  • Mismatched range sizes. If A2:A100 has 99 rows but C2:C99 has 98, Excel returns #VALUE!. All ranges must be the same height.
  • Using commas instead of asterisks between conditions. A comma inside SUMPRODUCT multiplies arrays in a way that often produces zero or wrong results. Use * for AND logic.
  • Forgetting parentheses around each condition. A2:A100="Widget"*B2:B100="North" is invalid. Each comparison needs its own parentheses.
  • Including text in the sum range. SUMPRODUCT treats text as zero, but if the sum range contains errors like #N/A, the whole formula returns an error.
  • Using whole-column references like A:A. This works but is slow on large sheets. Prefer bounded ranges such as A2:A1000.

Tips

  • For three or more criteria, just add more (range=criteria)* blocks before the sum range.
  • To use OR logic (either condition), add the conditions instead of multiplying: =SUMPRODUCT(((A2:A100="Widget")+(B2:B100="North"))*C2:C100). This counts rows matching either criterion, but can double-count rows matching both — wrap each condition in --() or use SIGN() if needed.
  • Wildcards work inside criteria: "Wid*" matches any text starting with Wid.
  • If you have Excel 2019 or Microsoft 365, SUMIFS is often faster and easier to read for simple AND sums: =SUMIFS(C2:C100,A2:A100,"Widget",B2:B100,"North"). SUMPRODUCT remains useful for OR logic and array math.
  • Press F4 to lock ranges with $ if you plan to copy the formula down or across.

Troubleshooting

If you see #VALUE!, check that all ranges are the same size and contain no error values. If the result is 0 when you expect a number, confirm the criteria text matches exactly — extra spaces, different capitalization (SUMPRODUCT is not case-sensitive, but trailing spaces matter), or numbers stored as text will cause misses. Use =TRIM() on your data or check with =ISTEXT() if unsure. If the formula returns #NAME?, you may have mistyped SUMPRODUCT or used a function not available in your Excel version. If the file is shared, ensure the ranges still point to the right columns after any insertions or deletions.

Frequently Asked Questions

Can SUMPRODUCT handle more than two criteria?

Yes. Add another (range=criteria)* block for each additional condition, keeping all ranges the same height.

Does SUMPRODUCT work with dates as criteria?

Yes, as long as the dates are real Excel dates, not text. Use (A2:A100>=DATE(2024,1,1))*(A2:A100<=DATE(2024,12,31)) for a date range.

What is the difference between SUMPRODUCT and SUMIFS?

SUMIFS is designed for multiple AND conditions and is usually faster on large datasets. SUMPRODUCT is more flexible for OR logic and array calculations, and works in older Excel versions without array entry.

Why does my SUMPRODUCT formula return a decimal when summing whole numbers?

This can happen if the sum range contains hidden decimals or if the multiplication of TRUE/FALSE values produces floating-point rounding. Format the cell as a number with zero decimals, or wrap the formula in ROUND().

Can I use SUMPRODUCT with a criteria range that includes blanks?

Yes. Blank cells in a criteria range will not match a text criterion, so they are effectively ignored. If you need to count blanks, use "" as the criterion.