Excel Not Equal Sign: How to Use the <> Operator

How-to basics · Updated November 18, 2026

Excel’s not equal sign is <>. Put it between two values in a formula to check whether they differ; Excel returns TRUE when they are different and FALSE when they match.

What Excel’s not equal operator means

The symbol <> is a comparison operator in Microsoft Excel for Microsoft 365 on Windows. It asks a yes-or-no question: are these two values not equal? The answer is a logical value, TRUE or FALSE, which you can use by itself or as the test in a larger formula.

For instance, a comparison can check whether a sales entry differs from a target, whether a status is not “Complete,” or whether two cells contain different dates. The operator does not change either value; it evaluates the comparison and returns a result. Excel will display TRUE or FALSE in the formula cell unless the result is used in another calculation or formatted differently.

The characters must appear in this order: less-than sign, then greater-than sign. Excel does not use the mathematical symbol ≠ as its worksheet comparison operator. It can be tempting to paste that symbol into a formula because it means “not equal” in mathematics, but Excel formulas use <>.

Basic syntax and examples

A comparison formula starts with an equals sign, followed by the first value or cell reference, the operator, and the second value or reference. With a city in A2 and another city in B2, this formula checks whether the entries differ:

=A2<>B2

If A2 contains Seattle and B2 contains Portland, the result is TRUE. If both cells contain Seattle, the result is FALSE. Changing either cell recalculates the comparison automatically.

You can also compare a cell with a fixed value. Text values in a formula need straight double quotation marks. With a status in A2, this comparison checks whether it is anything other than “Paid”:

=A2<>"Paid"

If A2 contains “Pending,” the formula returns TRUE; if it contains “Paid,” it returns FALSE. For numbers and dates, you can generally compare the cell directly with the numeric value or date serial you want to test. For clarity, date comparisons are often easier to read when the date is stored in a cell rather than typed as a number inside the formula.

Use not equal with IF and other functions

A comparison becomes especially useful when it controls what a formula returns. IF evaluates a test and returns one value when the test is TRUE and another when it is FALSE. With a delivery note in B2, use this formula to show a message only when the cell is not blank:

=IF(B2<>"","Ready","Missing")

If B2 contains a note, the result is “Ready”; if B2 is empty, the result is “Missing.” The empty text string "" is commonly used to test for an apparently empty cell. If cells contain formulas that return an empty string, this check treats those results as empty too. A cell containing spaces, however, is not empty, so hidden or accidental spaces can affect the outcome.

Not equal also appears in criteria-based functions, but the criteria are written as text. With status values in A2:A6 containing Paid, Pending, Paid, Review, and Pending, count entries that are not Paid like this:

=COUNTIF(A2:A6,"<>Paid")

The result is 3: two Pending entries and one Review entry. In this context, the operator and the value are combined inside a quoted criteria string. That differs from a direct comparison such as A2<>B2, where the operator sits between cell references and the text being compared is quoted separately.

To count nonblank cells, COUNTIF can use the not-blank criterion. With names in A2:A6 containing Alex, a blank cell, Jordan, Casey, and another blank cell, this formula returns 3:

=COUNTIF(A2:A6,"<>")

Remember that criteria functions interpret their criteria according to their own rules. If your range contains blanks, formulas returning empty strings, or wildcard characters, test the result against a small sample so you know exactly which records are included.

Text, numbers, blanks, and letter case

Excel’s ordinary text comparison with <> is not case-sensitive. For example, “north” and “North” are treated as equal by a standard not-equal comparison. This is usually useful for labels and categories, where capitalization differences should not create false mismatches.

If capitalization matters, use the EXACT function to compare the text case-sensitively, and NOT to reverse its result. With A2 containing “North” and B2 containing “north,” this formula returns TRUE because the entries differ in case:

=NOT(EXACT(A2,B2))

Text and numbers deserve extra attention when data has been imported or copied from another system. A value that looks like the number 25 may be stored as text, and that can affect comparisons, sorting, and calculations. Do not assume that visually identical entries have the same underlying type. Check the source data and, when needed, convert values consistently before relying on a comparison.

Blank-looking cells can also have different contents. A truly empty cell, a cell containing a space, and a cell with a formula that returns an empty string may look similar but are not identical in every Excel operation. If a comparison behaves unexpectedly, inspect the cell contents and the formula that produced them rather than assuming the display tells the whole story.

Use not equal in conditional formatting

You can highlight values that do not match a chosen status instead of displaying TRUE or FALSE in a separate column. In Excel for Microsoft 365 on Windows, select the range to format, then choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. If the selected range is A2:A100 and each cell contains a status, enter this rule formula:

=$A2<>"Paid"

Choose a format, such as a fill color, and confirm the rule. The formula returns TRUE for a status such as Pending, so Excel applies the format to that cell; it returns FALSE for Paid. The dollar sign fixes the column reference while leaving the row relative, allowing the rule to evaluate each row in the selected range. In Excel for Mac, use the Home tab’s Conditional Formatting controls; dialog labels and placement can vary slightly by release.

For a comparison between two columns, select the cells you want formatted and use a relative row reference in the rule. For example, a rule comparing A2 with B2 can be applied down corresponding rows so each row highlights when its two entries differ. Check the selected range and the first row in the formula: a mismatch there is a common reason a rule highlights the wrong cells.

Common mistakes and how to fix them

  • Using ≠ instead of <>: Replace the mathematical symbol with the two-character Excel operator. Excel formulas need the exact operator syntax.
  • Forgetting the formula’s leading equals sign: A worksheet formula begins with =. Without it, Excel may treat the entry as text rather than calculate it.
  • Putting quotes around cell references: A reference such as A2 should usually be unquoted. Quotes are for literal text or for criteria strings in functions such as COUNTIF.
  • Adding spaces that are really present: “Paid” and “Paid ” can look alike but contain different text. Check for trailing spaces when imported data produces surprising results.
  • Expecting a comparison to ignore errors: If a referenced cell contains an error, a comparison involving it can return an error instead of TRUE or FALSE. Resolve or handle the source error if the comparison needs to continue.

When troubleshooting, test the comparison in an unused cell first. That separates the logic from conditional formatting, a larger IF formula, or a function’s criteria rules. Also confirm that the referenced cells are the ones you intended; relative references can shift when a formula is copied, while dollar signs keep selected row or column references fixed.

How not equal compares with other operators

Excel’s main comparison operators are equals (=), less than (<), greater than (>), less than or equal to (<=), greater than or equal to (>=), and not equal to (<>). They all return TRUE or FALSE in a direct comparison. Choose the operator that states the condition you actually need; “not equal” is not interchangeable with “greater than” or “less than.”

For example, a rule that excludes one exact status is naturally expressed with not equal. A rule that keeps only values above a threshold needs a greater-than comparison. In a longer formula, NOT can reverse a logical test, but for a simple unequal comparison, <> is usually the clearest option. In a COUNTIF criterion, use the criteria form with the operator and the value together in quotation marks; in an ordinary worksheet comparison, place the operator between the two values being compared.

Frequently Asked Questions

What is the not equal sign in Excel?
It is <>, made from a less-than sign followed by a greater-than sign. Use it between two values or references in a formula to test whether they differ.

Why does Excel use <> instead of ≠?
Excel’s formula language uses <> as its not-equal comparison operator. The mathematical symbol ≠ may be useful in written explanations, but it is not a substitute for the operator in a worksheet formula.

How do I count cells that are not equal to a value?
Use COUNTIF with a criterion that combines <> and the value in quotation marks. For example, the article’s Paid-status example counts entries that are not Paid in the specified range.

Is Excel’s not equal comparison case-sensitive?
No. A standard text comparison with <> does not distinguish uppercase from lowercase. Use EXACT with NOT when the difference in capitalization should count as a mismatch.

How do I check whether a cell is not blank?
For a direct test, compare the cell with an empty text string; in COUNTIF, the not-blank criterion is "<>". Be aware that a space is content, and a formula returning an empty string can look blank even though a formula is present.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.