To sum values in Excel while excluding a specific value or text string, use the "not equal to" operator, which is written as <>. In a SUMIFS formula, you wrap this operator in double quotation marks (e.g., "<>Value") within the criteria argument to tell Excel to include everything except that specific entry.
What You'll Need
- A dataset with a column of numbers to sum (the sum_range).
- A column containing the categories or values you wish to filter (the criteria_range).
- The specific value or text string you want to exclude from the total.
Step-by-Step
- Identify your ranges: Determine which column contains the numbers you want to add up (e.g., Column B) and which column contains the labels you want to filter (e.g., Column A).
- Start the formula: Click on the cell where you want the result to appear and type
=SUMIFS(. - Select the Sum Range: Highlight the range of cells containing the numbers. For example,
B2:B10. Type a comma to move to the next argument. - Select the Criteria Range: Highlight the range of cells that contains the values you are checking against. This must be the same size as your sum range. For example,
A2:A10. Type another comma. - Enter the "Not" Criteria:
- For a hard-coded value: If you want to exclude the word "Pending", type
"<>Pending". - For a cell reference: If the value you want to exclude is written in cell D1, type
"<>="&D1. The ampersand (&) is required to join the operator to the cell reference.
- For a hard-coded value: If you want to exclude the word "Pending", type
- Close and execute: Type the closing parenthesis
)and press Enter.
Common Mistakes
- Forgetting Quotation Marks: The
<>operator must be enclosed in double quotes. If you type<>Valuewithout quotes, Excel will return a formula error. - Mismatched Range Sizes: The sum_range and the criteria_range must be exactly the same dimensions. If your sum range is
B2:B10but your criteria range isA2:A11, the formula will return a #VALUE! error. - Incorrect Cell Reference Syntax: A common error is writing
"<>D1". This tells Excel to look for the literal text "D1" rather than the value inside cell D1. You must use"<>="&D1. - Hidden Spaces: If your criteria is
"<>Completed"but your data contains "Completed " (with a trailing space), Excel will not recognize them as the same, and the "Completed " row will be accidentally included in the sum.
Tips
- Case Insensitivity: SUMIFS is not case-sensitive. Excluding "Pending" will also exclude "pending" or "PENDING".
- Using Wildcards: You can combine the not-equal operator with wildcards. For example,
"<>*West*"will exclude any cell that contains the word "West" anywhere in the text. - Multiple Exclusions: You can exclude multiple different values by adding more criteria pairs. For example:
=SUMIFS(B2:B10, A2:A10, "<>Pending", A2:A10, "<>Cancelled"). This sums everything that is neither Pending nor Cancelled. - Absolute References: If you plan to drag your formula down or across, use dollar signs to lock your ranges (e.g.,
$B$2:$B$10) so they do not shift.
Troubleshooting
If your formula is returning 0 or an error, try these steps in order:
- Check for #VALUE! errors: This almost always means your ranges are different sizes. Ensure both the sum range and criteria range start and end on the same row numbers.
- Verify Number Formatting: Ensure the numbers in your sum_range are actually formatted as numbers and not as text. If they are stored as text, SUMIFS will ignore them and return 0.
- Test with a Simple SUMIF: Try a basic
=SUM(B2:B10)to ensure the numbers are addable, then try a positive=SUMIFS(B2:B10, A2:A10, "Value")to ensure your criteria range is being read correctly. - Trim Your Data: If the exclusion isn't working, use the
=TRIM()function on your criteria column to remove invisible leading or trailing spaces that might be interfering with the match.
Frequently Asked Questions
Can I use "NOT" instead of "<>"?
No. The NOT() function is a logical function used for TRUE/FALSE tests; it cannot be used inside the criteria argument of a SUMIFS formula. You must use <>.
How do I sum cells that are not blank?
To sum values where the criteria cell is not empty, use the criteria "<>". This tells Excel to sum any row where the criteria cell contains any data at all.
Does this work for numbers as well as text?
Yes. To exclude a specific number, such as 100, you can use "<>100". The logic remains the same regardless of whether the data is numeric or text.
Can I exclude a range of values (e.g., not between 10 and 20)?
Yes, but you must add two separate criteria for the same range. For example, to exclude values between 10 and 20, you would set one criteria to "<10" and another to ">20", though this requires a different logic (SUMming the outsides) rather than a single "not" statement.
Why is my formula returning a #NAME? error?
A #NAME? error usually means there is a typo in the function name (e.g., writing SUMIFSS instead of SUMIFS) or a missing quotation mark around the criteria string.