The "does not equal" sign in Excel is <>, and it goes inside a formula to test whether two values are different
When you want Excel to check if one thing is not the same as another, you use the not equal operator, written as <>. It works in formulas that make decisions — usually inside an IF statement. For example, =IF(A1<>B1,"Different","Same") tells Excel to show "Different" if the value in A1 is not the same as B1, and "Same" if they match.
The <> symbol is not the same as the minus sign or any other character. You type it by pressing the less-than key (<) followed when ready by the greater-than key (>), with no space between them. Excel recognizes it as a single operator.
Key Takeaways
- The not equal operator in Excel is <>, typed as the less-than symbol followed when ready by the greater-than symbol.
- Use <> inside IF statements to make Excel show different results based on whether two values match or differ.
- The <> operator works with numbers, text, dates, and cell references — anything you can compare.
- You can combine <> with other operators like AND and OR to test multiple conditions at once.
Where you actually use <> in a spreadsheet
The most common place to use <> is inside an IF formula. The basic structure is =IF(condition, value if true, value if false). When your condition uses <>, Excel checks whether two things are different. If they are, it does the first thing you asked for. If they are the same, it does the second thing.
For example, if you have a list of employee names in column A and a list of approved names in column B, you could write =IF(A2<>B2,"Check this","OK") in column C. Excel will show "Check this" for any row where the names do not match, and "OK" where they do. This works for finding data entry errors or flagging records that need review.
You can also use <> in other functions that accept conditions, like COUNTIF or SUMIF. For instance, =COUNTIF(A:A,"<>Pending") counts how many cells in column A contain anything other than the word "Pending".
Comparing different types of data with <>
The <> operator works the same way whether you are comparing numbers, text, dates, or the contents of cells. If you write =IF(A1<>100,"Not 100","Is 100"), Excel checks whether A1 contains the number 100. If A1 holds 99 or 101 or "100" as text, the result is "Not 100".
When comparing text, Excel is case-insensitive by default, meaning "apple" and "APPLE" are treated as equal. If you need to catch differences in capitalization, you will need a different approach — the EXACT function, which does care about case: =IF(EXACT(A1,B1),"Same","Different").
For dates, <> works as long as both cells are formatted as dates. If one cell holds a date and the other holds text that looks like a date, they will not be equal, and <> will return true (they are different).
Combining <> with AND and OR
You can test multiple conditions at once by combining <> with AND or OR. Use AND when all conditions must be true, and OR when at least one must be true.
For example, =IF(AND(A1<>B1, A1<>C1),"Different from both","Matches at least one") checks whether A1 is different from both B1 and C1. If both conditions are true, it shows "Different from both". If A1 matches either B1 or C1, it shows "Matches at least one".
Or, =IF(OR(A1<>"Yes", B1<>"Approved"),"Review needed","All clear") checks whether A1 is not "Yes" or B1 is not "Approved". If either one is true, it shows "Review needed".
Common mistakes with the <> operator
The most frequent error is typing the wrong symbol. People sometimes use != (which works in some programming languages but not Excel), or they type < and > with a space between them. Excel will not recognize these as the not equal operator and will show an error.
Another mistake is forgetting to put the <> operator inside a function that expects it. You cannot just type A1<>B1 in a cell by itself — it needs to be part of an IF, COUNTIF, SUMIF, or another formula that knows what to do with a true or false result.
People also sometimes confuse <> with the equal sign (=). Remember: a single = at the start of a cell means "this is a formula". The <> inside a formula means "is not equal to".
Using <> to filter and highlight data
Beyond formulas, you can use <> in Excel's AutoFilter feature to hide rows that match a certain value. Click the filter dropdown arrow in a column header, choose "Standard Filter" or "Custom Filter", and set the condition to "does not equal" with the value you want to exclude. This is faster than writing a formula if you just want to look at certain rows temporarily.
You can also use <> in conditional formatting to highlight cells that are different from a reference value. Go to Home > Conditional Formatting > New Rule, choose "Use a formula to determine which cells to format", and write something like =$A1<>$B1. Excel will highlight every cell in your selection where the value in column A does not match the value in column B.
Frequently Asked Questions
What is the difference between <> and !=?
Excel uses <> for "not equal". The != symbol works in some programming languages like Python or JavaScript, but Excel does not recognize it. If you type != in an Excel formula, you will get an error. Always use <> in Excel.
Can I use <> to compare text that might have extra spaces?
Not directly — <> will see "apple " (with a space) as different from "apple" (without a space). If you need to ignore spaces, wrap both values in the TRIM function first: =IF(TRIM(A1)<>TRIM(B1),"Different","Same"). TRIM removes extra spaces from the beginning, end, and middle of text.
Does <> work with blank cells?
Yes. A blank cell is treated as empty, so =IF(A1<>"","Has content","Empty") will show "Has content" if A1 has anything in it, and "Empty" if it does not. You can also write =IF(A1<>"") to test whether a cell is not blank.
Can I use <> in a formula that counts or sums?
Yes, with COUNTIF and SUMIF. For example, =COUNTIF(A:A,"<>0") counts all cells in column A that are not zero, and =SUMIF(B:B,"<>Cancelled",C:C) sums values in column C where the corresponding cell in column B is not "Cancelled".