The does not equal sign in Excel is <>, and it goes inside a formula to test whether two values are different
When you type <> between two values or cell references in Excel, the formula returns TRUE if they are not equal and FALSE if they are the same. You use it most often inside an IF statement to make a decision based on whether something matches or not. For example, =IF(A1<>B1,"Different","Same") will display "Different" if the value in A1 does not match B1, and "Same" if they do match.
The symbol works with numbers, text, dates, and any other data type Excel stores. It is case-insensitive for text, meaning "apple" and "APPLE" are treated as equal. If you need case-sensitive comparison, you will need a different approach using the EXACT function instead.
Key Takeaways
- The does not equal operator is <>, typed as a less-than sign followed immediately by a greater-than sign with no space between them.
- Use it inside IF, COUNTIF, SUMIF, and other conditional functions to test whether values differ from each other.
- The formula returns TRUE when values do not match and FALSE when they do, which you can use to trigger actions or count rows.
- Text comparison is not case-sensitive by default, so "apple" and "APPLE" are treated as equal unless you use the EXACT function.
Where to type the does not equal sign
You type <> inside the formula bar at the top of Excel, not in the cell itself. Start with an equals sign to begin the formula, then build your condition. The most common place is inside an IF statement: =IF(A1<>"text",value_if_true,value_if_false). You can also use it in COUNTIF to count cells that do not match a value, or in SUMIF to add up rows where a condition is not met.
The symbol must have no spaces around it. =A1<>B1 works; =A1 <> B1 does not. Excel will show an error if you add spaces or if you type the symbol backwards as ><.
Common formulas using does not equal
The IF statement is the most straightforward use. =IF(A1<>B1,"Values differ","Values match") compares two cells and displays text based on whether they are different. You can nest multiple conditions: =IF(AND(A1<>B1,C1<>D1),"Both pairs differ","At least one pair matches") checks whether two separate pairs are both unequal.
COUNTIF counts how many cells in a range do not equal a specific value. =COUNTIF(A1:A10,"<>0") counts every cell in A1 through A10 that is not zero. SUMIF adds values from one column based on a condition in another: =SUMIF(B1:B10,"<>Pending",C1:C10) sums the values in C1:C10 only for rows where column B is not "Pending".
Comparing text versus numbers
The does not equal sign treats text and numbers differently. When comparing numbers, =5<>5.0 returns FALSE because Excel recognizes them as the same value. When comparing text, also returns FALSE because text comparison ignores uppercase and lowercase by default.
If you need to distinguish between uppercase and lowercase letters, use the EXACT function instead: =IF(EXACT(A1,B1),"Exact match","Different case or content"). EXACT returns TRUE only if both the text and the case match exactly. You can combine it with NOT to replicate does not equal behavior for case-sensitive text: =IF(NOT(EXACT(A1,B1)),"Not an exact match","Exact match").
Using does not equal with blank cells
Testing whether a cell is not blank uses the same symbol. =IF(A1<>"","Cell has content","Cell is empty") checks whether A1 contains anything at all. This is useful for validation formulas that flag incomplete rows or missing data. You can also use it in conditional formatting to highlight cells that should have values but do not.
Be aware that a cell containing only a space character is not blank — it has content. =IF(A1<>" ","Not blank","Blank") would return "Not blank" for a cell with a single space. If you need to catch spaces as well, use the TRIM function to remove them first: =IF(TRIM(A1)<>"","Has content","Empty").
Combining does not equal with other operators
You can use <> alongside other comparison operators like <, >, <=, and >= inside AND or OR functions. =IF(AND(A1<>0,A1>10),"Greater than 10 and not zero","Does not meet both conditions") requires both conditions to be true. =IF(OR(A1<>B1,C1<D1),"Either values differ or C is less than D","Neither condition is true") returns TRUE if at least one condition is met.
You can also nest does not equal inside other functions. =AVERAGEIF(A1:A10,"<>0",B1:B10) calculates the average of B1:B10 but only for rows where A is not zero, excluding zero values from the calculation. This is useful for filtering out placeholder values or incomplete entries.
Troubleshooting does not equal formulas
If your formula returns an error, check that you typed <> correctly with no spaces and in the right order. A common mistake is reversing it to ><, which Excel does not recognize. Another is forgetting the equals sign at the start of the formula: A1<>B1 displays as text, not a result, because Excel does not know it is a formula.
If the formula returns an unexpected result, verify that you are comparing the right data types. Text that looks like a number (such as "5" stored as text) may not equal the actual number 5. Use the TYPE function to check: =TYPE(A1) returns 1 for numbers and 2 for text. You can also use the VALUE function to convert text to numbers if needed: =IF(VALUE(A1)<>5,"Not 5","Equals 5").
Frequently Asked Questions
How do I type the does not equal sign on my keyboard?
Press the less-than key (Shift + comma) immediately followed by the greater-than key (Shift + period) with no space between them. The result is <>. On most keyboards this is straightforward, but on some international layouts the key positions may differ — check your keyboard map if you cannot find them.
Can I use does not equal to compare dates?
Yes. =IF(A1<>B1,"Dates differ","Same date") works with date values just as it does with numbers and text. Excel stores dates as numbers internally, so the comparison is reliable. Make sure both cells are formatted as dates, or the comparison may fail if one is text that looks like a date.
What is the difference between <> and NOT?
<> is a direct comparison operator that returns TRUE or FALSE based on inequality. NOT is a function that reverses a TRUE or FALSE result. =IF(A1<>B1,"Different","Same") and =IF(NOT(A1=B1),"Different","Same") produce the same outcome, but the first is simpler and more readable.
Does does not equal work in conditional formatting?
Yes. In conditional formatting, select your range, choose "Formula is" as the rule type, and enter a formula like =A1<>"Approved". Excel will highlight every cell in the range where the condition is true. This is useful for flagging incomplete entries, pending items, or any cells that do not match an expected value.
What happens if I compare a number to text with does not equal?
Excel treats them as not equal. =5<>"5" returns TRUE because 5 (a number) is not the same as "5" (text). If you need to compare them as equivalent, convert one to match the other using VALUE or TEXT functions first.