Expires in:
This article teaches you how to test for conditions that are not true in Excel using the NOT function and the not equal to operator (<>). You will learn when to use each approach, see live formula examples, and get troubleshooting tips so your formulas behave reliably. It is aimed at Excel users who already know IF and want clearer, more readable logical tests.

Key Take-Aways
- You can test for "not" conditions in two common ways: the NOT function and the not equal to operator (<>).
- =IF(NOT(C2=0), "Wet", "Dry") and =IF(C2<>0, "Wet", "Dry") produce the same result; <> is usually cleaner.
- Use <>"" to test for non-blank cells and <> value comparisons for numbers and text. <> is case-insensitive.
- Watch out for errors from upstream cells. Use IFERROR, ISBLANK, or separate tests to avoid unexpected #N/A or #VALUE! results.
- Combine NOT or <> with AND/OR to build more complex logic, but avoid double negatives for readability.
## What does a "not" test do in Excel
A "not" test checks whether a condition is false. In plain terms it answers questions like: "Is this cell not equal to zero?" or "Is this cell not blank?" Excel gives you two straightforward ways to express this.
Definitions
- NOT function: A built-in function that flips the truth value of a logical test. Example: NOT(A2=0) returns TRUE when A2 is not equal to 0.
- Not equal to operator (<>): A comparison operator that directly tests inequality. Example: A2<>0 returns TRUE when A2 is not equal to 0.
Both approaches are valid. Which you use is usually a matter of readability and simplicity.
## Two equivalent ways to test "not"
Example goal: mark a row as "Wet" if precipitation is greater than zero, otherwise "Dry".
1) Using NOT
=IF(NOT(C2=0), "Wet", "Dry")
How it works
- The inner test C2=0 returns TRUE if precipitation equals zero.
- NOT flips that result. NOT(TRUE) becomes FALSE; NOT(FALSE) becomes TRUE.
- IF then returns "Wet" when the flipped result is TRUE.
2) Using the not equal to operator
=IF(C2<>0, "Wet", "Dry")
How it works
- C2<>0 directly returns TRUE when C2 is not zero and FALSE when it is zero.
- IF returns the corresponding text.
Why use <> more often
- Shorter and easier to read: fewer parentheses and less cognitive overhead.
- Less nesting: you avoid an extra logical function call.
- Directly expresses inequality, which is exactly what you intend.
Where NOT can still be useful
- When you already have a logical expression and want to invert it without rewriting it.
- When combining tests programmatically or when clarity is improved by explicitly calling out the negation.
## Copying formulas: relative and absolute references
When you write =IF(C2<>0, "Wet", "Dry") and drag it down, Excel updates C2 to C3, C4, etc. That is relative referencing. If you want to compare every row to a fixed cell, use absolute references like $C$2.
Examples
- Relative copy: =IF(C2<>0, "Wet", "Dry") -> becomes =IF(C3<>0, "Wet", "Dry") when copied down one row.
- Fixed comparison: =IF($C$2<>0, "Wet", "Dry") always looks at C2.
## Handling blanks, text, and other types
- Test for non-blank: =IF(A2<>"", "Has value", "Blank").
- Test for specific text: =IF(A2<>"complete", "Pending", "Complete"). Note that <> is case-insensitive; "Complete" and "complete" are treated the same.
- For case-sensitive comparisons use EXACT inside NOT: =IF(NOT(EXACT(A2, "complete")), "Not exact", "Exact"). EXACT returns TRUE only for exact case matches.
## Common error sources and how to fix them
- Upstream errors: If the cell you reference contains an error (for example, because of a divide by zero or VLOOKUP #N/A), your IF test may return an error too.
- Fix: Use IFERROR around the whole expression or test for the error explicitly with ISERROR or ISNA. Example: =IFERROR(IF(C2<>0, "Wet", "Dry"), "Check data")
- Blank versus zero: Blank cells are not the same as zero. Use <>"" to test for blanks and <>0 to test numeric non-equality.
- Data types: Text that looks numeric will be treated as text. Use VALUE() to convert if needed or check with ISNUMBER.
## Combining NOT or <> with AND / OR
You can nest comparisons to build richer logic:
- AND example: =IF(AND(A2>50, B2<>""), "Qualified", "Not qualified")
- OR example: =IF(OR(C2<>0, D2<>0), "Some precipitation", "No precipitation")
Avoid double negatives. For example prefer C2<>0 instead of NOT(C2=0) for clarity.
## Practical step-by-step: replace an OR-based test with <>
1. Select the cell with the existing IF formula.
2. Delete or backspace the formula you want to replace.
3. Type =IF(
4. Click the precipitation cell (for example C2) then type <>0,
5. Add the true and false results: "Wet", "Dry" and close with ).
6. Press Enter and drag the fill handle to copy down.
This produces the same output as using NOT or OR-based constructions but with cleaner syntax.
Additional Tips, Pitfalls to Avoid & Pro Advice
- Prefer <> when testing inequality. It reads better and is less error-prone.
- Use IFERROR or explicit ISBLANK/ISNUMBER checks when your data may contain errors or text that looks numeric.
- When testing blanks, use <>"" rather than <>0. They are different tests.
- For complex logic, break tests into helper columns. A helper column makes debugging easier and preserves readability.
- Avoid nested NOTs. Double negation is confusing. If you need a positive condition, rewrite the test positively.
FAQ
Q: How do I check if a cell is not equal to a value in Excel?
A: Use the not equal to operator. Example: =IF(A2<>10, "Not 10", "Is 10"). This returns "Not 10" when A2 is any value other than 10.
Q: Is the <> operator case-sensitive when comparing text?
A: No. <> is case-insensitive. Use EXACT inside a NOT wrapper for case-sensitive comparisons: NOT(EXACT(A2, "text")).
Q: When should I use NOT instead of <>?
A: Use NOT when you already have a logical expression and want to invert it, or when inverting improves clarity. For simple inequality use <>.
Q: Why am I getting an error when I use IF with a not test?
A: Often the cell you reference contains an error or the data type is unexpected. Wrap with IFERROR or test the cell with ISNUMBER, ISBLANK, or ISERROR before using the comparison.
Q: How do I test for a non-blank cell?
A: Use <>"". Example: =IF(A2<>"", "Has data", "Blank"). This returns TRUE when A2 contains anything including text or numbers.
Summary of Key Points / Take-Home Messages
- You can invert tests with NOT or use the not equal operator <>; both work but <> is simpler for inequality.
- Use <>"" to test for non-blanks and <>value for numeric/text comparisons.
- Watch for upstream errors and data type mismatches; use IFERROR, ISBLANK, or ISNUMBER to guard your tests.
- Combine with AND/OR for richer conditions but keep tests readable, and use helper columns when logic gets complex.
- Prefer clear, positive conditions when possible to minimize confusion and maintenance effort.






