SUMIF adds up the numbers in a range only when they meet a condition you set. For example, you can total all sales for a specific product, or sum expenses above a threshold. The function is built into every modern version of Excel and works the same on Windows, Mac, and Excel for the web. You need a worksheet with at least one column of values to sum and one column of criteria to check.
What You'll Need
- Excel 2010 or later (or Excel for the web) — the function is not available in very old versions.
- A table with a column of numbers (the sum range) and a column of labels or values (the criteria range).
- Basic familiarity with cell references like A2:A100.
Step-by-Step
- Identify your ranges. Decide which column holds the numbers you want to add (the sum range) and which column holds the condition (the criteria range). They must be the same size — for example, both from row 2 to row 100.
- Click the cell where you want the result. This is where the total will appear.
- Type =SUMIF( to start the function. Excel will show a tooltip with the argument order: range, criteria, [sum_range].
- Enter the criteria range. Select the cells that contain the values you want to test — for example, B2:B100 if column B holds product names. Type a comma.
- Enter the criteria. This can be a number (100), a text string in quotes ("Apples"), a cell reference (D2), or an expression in quotes (">50"). Type a comma.
- Enter the sum range. Select the cells with the numbers to add — for example, C2:C100. If you omit this argument, Excel sums the criteria range itself, which is rarely what you want.
- Close the parenthesis and press Enter. The cell shows the total of all values in the sum range where the corresponding cell in the criteria range matches your condition.
- Copy the formula down or across if needed. Use absolute references ($B$2:$B$100) for the ranges if you plan to fill the formula into other cells, so the ranges do not shift.
Example: =SUMIF(B2:B100, "Apples", C2:C100) adds every number in C2:C100 where the matching cell in B2:B100 equals "Apples".
Common Mistakes
- Mismatched range sizes. The criteria range and sum range must have the same number of rows and columns. If they differ, Excel may return a #VALUE! error or an incorrect total.
- Forgetting quotes around text or operators. Criteria like "Apples" or ">100" need double quotes. A cell reference does not.
- Using SUMIF when you need multiple conditions. SUMIF handles only one condition. For two or more, use SUMIFS (with an S).
- Including the header row. If your criteria range includes a header like "Product", it will not match unless you specifically search for that word. Start ranges at the first data row.
- Wildcards not working as expected. The asterisk (*) matches any sequence of characters, and the question mark (?) matches a single character. To find a literal asterisk, precede it with a tilde (~).
- Sum range omitted by accident. If you leave out the third argument, Excel sums the criteria range, which often gives a wrong result.
Tips
- Use cell references for criteria instead of hard-coded text so you can change the condition without editing the formula.
- For dates, use comparison operators in quotes: ">="&DATE(2024,1,1) sums values on or after January 1, 2024.
- SUMIF is not case-sensitive: "apples" and "Apples" are treated the same.
- To sum all values that are not blank, use "<>" as the criteria.
- If you need to sum with multiple criteria, switch to SUMIFS — the syntax is SUMIFS(sum_range, criteria_range1, criteria1, ...).
- Convert your data to an Excel Table (Ctrl+T) so ranges expand automatically when you add rows.
Troubleshooting
- Result is 0 when you expect a number. Check that the criteria range actually contains matching values. Text with extra spaces will not match — use TRIM or clean the data.
- #VALUE! error. Likely a range size mismatch or a criteria argument that Excel cannot interpret. Verify both ranges have the same dimensions.
- Wrong total. Make sure the sum range starts at the same row as the criteria range. If one starts at row 2 and the other at row 3, the sums will be offset.
- Criteria with wildcards not matching. Confirm the wildcard characters are correct and that the cell does not contain leading or trailing spaces.
- Formula not updating. Check that calculation is set to Automatic (Formulas > Calculation Options > Automatic).
- Numbers stored as text. If the sum range contains numbers stored as text, SUMIF may ignore them. Convert them to numbers (e.g., using VALUE or Text to Columns).
Frequently Asked Questions
Can SUMIF handle multiple criteria?
No. SUMIF accepts only one condition. Use SUMIFS for two or more criteria; it takes pairs of criteria ranges and criteria.
Does SUMIF work with dates?
Yes. Use comparison operators in quotes, e.g., ">="&DATE(2024,1,1). The date must be a real Excel date value, not text.
Is SUMIF case-sensitive?
No. "Apple" and "apple" are treated as the same criterion. For case-sensitive sums, use SUMPRODUCT with EXACT.
What is the difference between SUMIF and SUMIFS?
SUMIF sums based on one condition; SUMIFS sums based on multiple conditions. SUMIFS also places the sum range first in the argument list.
Can I use wildcards in SUMIF?
Yes. The asterisk (*) matches any number of characters, and the question mark (?) matches a single character. Use a tilde (~) before a wildcard to match it literally.
Why does my SUMIF return 0 for text criteria?
Check for extra spaces, non-printing characters, or mismatched range sizes. Also ensure the criteria is in quotes if it is a text string.