30 Advanced Excel Tips for 2026

Excel Champs / Excel Formulas List / How to use Does Not Equal Operator in Excel (Formula)
By Puneet Gogia (Microsoft MVP)

How to use Does Not Equal Operator in Excel (Formula)

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

The “does not equal” operator in Excel is <> — a less-than sign followed by a greater-than sign. Use it directly to compare two cells: =A1<>A2 returns TRUE when the values differ and FALSE when they match.

For a readable result instead of TRUE/FALSE, wrap it in IF: =IF(A1<>A2,"Different","Same"). Inside functions that take criteria as text, the operator goes inside quotes: =COUNTIF(A1:A10,"<>North") counts everything except North, and =SUMIF(A1:A10,"<>North",B1:B10) sums the same rows.

To compare against a cell rather than typed text, join with an ampersand: =COUNTIF(A1:A10,"<>"&C1). Two things to know: <> is not case-sensitive, so “excel” and “EXCEL” count as equal — use =NOT(EXACT(A1,A2)) when case matters — and "<>" on its own means “not blank”, which is why it’s the standard way to count non-empty cells.

In Excel, if you want to check if a cell value is not equal to another value, you can use the not equal operator “<>”. It returns FALSE if the value matches and TRUE if it doesn’t match. You can use it as a formula, or you can also use it with other functions like IF, OR, and AND.

In the following example, you have two values in cells A1 and A2, and you need to check if value 1 is not equal to value 2.

two-values-in-cells

Using DOES NOT EQUAL Operator

  1. First, in cell B1, enter the equal operator.
  2. After that, refer to cell A1 where you have the first value.
  3. Next, enter the “<>” not equal operator.
  4. Now, refer to the second value that we have in cell A2.
  5. In the end, hit Enter to get the value.
use-not-equals-operator

Here’s the formula:

=A1<>A2

The moment you hit Enter, it returns TRUE in the result. This is because the two values are not equal. Now if you change cell A2 to the same value as A1 (“Excel” in our example), the result in cell B1 changes to FALSE. The reason is that we have the same value in both cells.

change-value-in-cell

Using DOES NOT EQUAL with OR – AND

As I said, you can use the not equals operator with other functions as well. Let’s try to use it with AND and OR functions.

With the OR function, you can test two conditions, and it will return TRUE if any one of the conditions or both conditions are TRUE. In the following example, we have two conditions to test: comparing the values from cells A1 and A2, and then from B1 and B2.

not-equals-operator-with-or

Here’s the formula that we have used:

=OR(A1<>A2,B1<>B2)

Now, as we are using the does not equal operator in both conditions, and in the first condition both values are not equal, it returns TRUE. But after that, in the second condition, both values are the same, so the condition is FALSE.

But in the result, we have got TRUE, because, as we have discussed, OR returns TRUE even if only one condition is TRUE.

Next, use the same with the AND function. AND returns TRUE only if all the specified conditions are TRUE, and FALSE if even one of the conditions is FALSE.

not-equals-operator-with-end

In the above example, again we have the same values, but when you use the AND function, it returns FALSE in the result, as the second condition (B1<>B2) is not true: both of the values are the same.

=AND(A1<>A2,B1<>B2)

The formula is the same as the OR one, only with AND.

Use DOES NOT EQUAL Operator with IF Function

You can also use the does not equal operator within the IF function.

not-equals-operator-with-if
  1. Enter the IF function in a cell where you want to have the result.
  2. After that, refer to cell A1 and then use the not equal operator and refer to cell A2.
  3. Next, use a value to get if the condition is TRUE.
  4. In the end, specify the value if the condition is FALSE.

Here’s the formula, which returns “Not Equal” when the values are different and “Equal” when they are the same:

=IF(A1<>A2,"Not Equal","Equal")

The best thing about using IF with the “does not equal” condition is that you can return a specific value of your choice when the condition is TRUE or FALSE.

Not Equal Is Not Case-Sensitive

The not equal operator ignores the case, so “excel” and “EXCEL” count as equal, and the formula returns FALSE. If you need a case-sensitive check, use EXACT with NOT:

=NOT(EXACT(A1,A2))

Also, a number and the same number stored as text are not equal. If A1 has 5 and A2 has “5” (text), the not equal formula above returns TRUE.

Not Equal in COUNTIF and SUMIF

In functions that take criteria, like COUNTIF and SUMIF, you write the operator inside the quotes along with the value. The following formula counts the cells in A1:A10 that are not “Apple”:

=COUNTIF(A1:A10,"<>Apple")

And this one sums the values in B1:B10 where the item in column A is not “Apple”:

=SUMIF(A1:A10,"<>Apple",B1:B10)

To use a value from a cell, join it with &, like “<>”&D1. Note that “<>Apple” also counts the empty cells in the range.

Frequently Asked Questions

How do I type the not equal sign in Excel?

Type the less than sign (<) followed by the greater than sign (>). Excel doesn’t accept the ≠ symbol in formulas.

How do I check if a cell is not blank?

Compare the cell with an empty text value (“”), using the not equal operator. It returns TRUE when the cell has any value.

Can I use not equal with dates?

Yes, as dates are numbers in Excel. But if one cell also has a time, the two values are not equal even on the same day; remove the time with INT first.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

Leave a Comment