SUMIF adds up numbers in a range only when a matching condition is met in another range. It is the quickest way to total sales for one product, expenses for one category, or hours for one employee without sorting or filtering. You need a worksheet with at least one column of criteria (text, numbers, or dates) and one column of values to add. The function works in Excel for Microsoft 365, Excel 2021, 2019, 2016, and Excel for the web; menu labels can differ slightly by version, device, or region, but the formula itself is the same.

What You'll Need

  • A worksheet with a criteria column (for example, product names or categories) and a value column (for example, sales amounts).
  • Column headers so you can use whole-column references or structured references if you prefer.
  • Basic familiarity with typing formulas in the formula bar or directly in a cell.
  • Excel for Microsoft 365, Excel 2021, 2019, 2016, or Excel for the web (desktop or mobile).

Step-by-Step

  1. Identify your ranges. Decide which column holds the criteria you want to match (for example, column A for product names) and which column holds the numbers to add (for example, column B for sales). The two ranges must be the same size, or SUMIF will return a #VALUE! error.
  2. Pick an empty cell where you want the result to appear. Click it once.
  3. Start the formula by typing =SUMIF(. Excel will show the argument names in a tooltip: range, criteria, [sum_range].
  4. Enter the criteria range. Type the range reference, such as A2:A100, or select it with your mouse. This is the column you want to check against your condition.
  5. Type a comma to move to the next argument.
  6. Enter the criteria. This can be a number (like 500), text in quotes (like "Widget"), a cell reference (like D2), or an expression in quotes (like ">1000" or "<>" for not blank). If you type text directly, wrap it in double quotes.
  7. Type a comma to move to the sum_range argument.
  8. Enter the sum range. This is the column with the numbers to add, such as B2:B100. If you omit it, Excel adds the numbers in the criteria range itself, which is rarely what you want.
  9. Close the parenthesis and press Enter. The cell shows the total for all rows where the criteria matched.
  10. Copy the formula down or across if you need the same calculation for other criteria. Use absolute references (like $A$2:$A$100) for the ranges so they do not shift when you copy.

Common Mistakes

  • Mismatched range sizes. If the criteria range and sum range are different heights, SUMIF returns #VALUE!. Always use the same number of rows.
  • Forgetting quotes around text criteria. SUMIF(A2:A10, Widget, B2:B10) will fail because Widget is not a defined name. Use "Widget".
  • Using the wrong comparison operator. For greater than or less than, put the operator inside quotes: ">100". For not equal, use "<>value".
  • Including the header row. If your range includes headers, the header text may accidentally match a criteria or cause errors. Start ranges at the first data row.
  • Expecting SUMIF to handle multiple conditions. SUMIF takes only one criteria. For two or more, use SUMIFS instead.
  • Wildcards not working as expected. The asterisk (*) matches any number of characters and the question mark (?) matches one character, but they only work with text criteria, not numbers.

Tips

  • Use cell references for criteria so you can change the condition without editing the formula. For example, put the product name in D2 and use SUMIF(A2:A100, D2, B2:B100).
  • For dates, use a cell reference or a function like ">="&DATE(2024,1,1) to build dynamic criteria.
  • If you need to sum based on multiple criteria, switch to SUMIFS. The syntax is SUMIFS(sum_range, criteria_range1, criteria1, ...).
  • Use whole-column references like A:A for simplicity, but be aware they can slow down large workbooks. Prefer bounded ranges.
  • Press F4 while editing a range reference to toggle absolute and relative references quickly.
  • To sum all values except a specific one, use "<>value" as the criteria.

Troubleshooting

If SUMIF returns an unexpected result, check these in order:

  • #VALUE! error: The ranges are different sizes. Resize them to match.
  • #NAME? error: A text criterion is missing quotes, or a function name is misspelled. Check the spelling and add quotes around text.
  • Result is 0 when you expect a number: The criteria may not match exactly. Check for extra spaces, different capitalization (SUMIF is not case-sensitive), or numbers stored as text. Use TRIM or VALUE to clean data.
  • Result includes unwanted rows: Your range may include headers or totals. Adjust the range to cover only data rows.
  • Formula does not update when criteria change: Ensure calculation is set to automatic (Formulas > Calculation Options > Automatic).
  • Wildcards not matching: Confirm the criteria is text and that wildcards are enabled (they are by default in Excel, but check File > Options > Advanced > Use wildcards in formulas).

Frequently Asked Questions

What is the difference between SUMIF and SUMIFS?

SUMIF adds values based on one condition. SUMIFS adds values based on multiple conditions and has a different argument order: sum_range comes first.

Can SUMIF use wildcards?

Yes, for text criteria. Use * to match any number of characters and ? to match a single character. For example, "Widget*" matches any text starting with Widget.

Does SUMIF work with dates?

Yes. Use a date in quotes like ">2024-01-01" or a cell reference to a date. For dynamic ranges, combine with DATE or TODAY functions.

Why does my SUMIF return 0?

Common causes: criteria does not match exactly (check for spaces or text vs. number formatting), ranges are mismatched, or the sum range contains text instead of numbers.

Can I use SUMIF across multiple sheets?

Yes, but you need to reference each sheet separately. SUMIF does not support 3D references across multiple sheets in a single formula; use SUMIFS with individual sheet references or consolidate data first.

Is SUMIF case-sensitive?

No, SUMIF is not case-sensitive. "Widget" and "widget" are treated the same. For case-sensitive sums, use SUMPRODUCT with EXACT.