Excel Not Equal Symbol: How to Use <> in Formulas

Formulas & functions · Updated November 18, 2026

In Microsoft Excel, the not-equal operator is <>—a less-than sign followed by a greater-than sign. Use it in a formula such as =A1<>B1 to test whether the values in A1 and B1 differ; Excel returns TRUE if they do and FALSE if they are equal.

What is Excel’s not-equal symbol?

The symbol <> is Excel’s comparison operator for “not equal to.” It is made from two ordinary keyboard characters, not the single mathematical character ≠. Although those symbols express the same idea in written mathematics, Excel formulas use <>.

In a worksheet formula, comparison operators go between the two values or references being compared. A formula starts with an equals sign, and the comparison then produces one of Excel’s logical results: TRUE or FALSE. For example, if A2 contains 125 and B2 contains 125, the comparison is false; if B2 contains 130, it is true.

With 125 in A2 and 130 in B2, enter =A2<>B2 in C2; the result is TRUE because the values differ. Change B2 to 125 and C2 returns FALSE. The result is a logical value, not the text “TRUE” or “FALSE,” so it can be used directly in functions such as IF.

Do not substitute !=, a convention used in some programming languages, or type the Unicode character ≠ in place of the operator. Those are not Excel’s not-equal comparison syntax. The actual Excel operator is always the two-character sequence <>.

How Excel evaluates a comparison

Excel reads <> as a test between the expressions on its left and right. Those expressions can be cell references, numbers, text, dates, or results returned by other calculations. A comparison can therefore check two cells, or compare a cell with a fixed value. The operator answers only whether the values are unequal; it does not calculate how far apart two numbers are.

With the number 20 in A2, enter =A2<>20 in B2; it returns FALSE. If A2 changes to 21, the result becomes TRUE. This makes the operator useful for auditing data, flagging changes, or separating records that match a specified value.

Excel also has the related operators = for equal to, > for greater than, < for less than, >= for greater than or equal to, and <= for less than or equal to. Choose the operator that describes the test you need: “not equal” is different from “greater than,” even if both happen to return TRUE for a particular pair of numbers.

Use not equal with IF

A common reason to use the operator is to return a useful label instead of TRUE or FALSE. IF checks a logical test, then returns one value when the test is true and another when it is false. This can turn a comparison into a status column, a change flag, or a simple instruction for a reviewer.

With an old value in A2 and a new value in B2, enter =IF(A2<>B2,"Changed","Same") in C2. If A2 is 125 and B2 is 130, C2 displays Changed; if both cells contain 125, it displays Same. The two quoted words are text results, while A2<>B2 is the logical test.

For a list of records, put the formula in the first result row and fill it down. Each row then compares its own A and B values. Check the references before copying: ordinary references such as A2 and B2 adjust to A3 and B3 in the next row, which is usually what a row-by-row comparison requires. If the formula should always refer to one fixed cell, use dollar signs to make that reference absolute.

Compare text and check capitalization

The not-equal operator works with text as well as numbers. If a status cell should contain the word Approved, a comparison can identify other entries. For ordinary Excel comparisons, text matching is not case-sensitive: “approved” and “Approved” are treated as equal. Thus, a not-equal test does not flag a capitalization difference by itself.

With a status in A2, enter =A2<>"Approved" in B2. If A2 contains Approved, the result is FALSE; if A2 contains Pending, it is TRUE. The quotation marks tell Excel that Approved is a text value. Without them, Excel may interpret the word as a name rather than as the text you intend to compare.

If capitalization matters, use the case-sensitive EXACT function and reverse its result with NOT. With text values in A2 and B2, enter =NOT(EXACT(A2,B2)) in C2. If A2 contains “Approved” and B2 contains “approved,” C2 returns TRUE because the strings are not an exact, case-sensitive match. EXACT returns TRUE for an exact match, so NOT makes the formula report the opposite.

Count or sum values that are not equal

Excel’s COUNTIF and SUMIF functions accept criteria that include a comparison operator. In these criteria arguments, the operator is written as text inside quotation marks. This differs slightly from a direct cell comparison, where the operator is part of the formula expression rather than a quoted criterion.

With A2:A6 containing North, South, North, a blank cell, and West, enter =COUNTIF(A2:A6,"<>") in B2. It returns 4, the number of cells in that range containing an entry. This is a handy way to count nonblank entries; if your range contains formulas that display empty strings, check the result against your data because a formula cell may not behave like a genuinely empty cell in every counting approach.

You can also count entries that differ from a particular value. With region names in A2:A6 and the comparison value South in D1, enter =COUNTIF(A2:A6,"<>"&D1) in D2. If the five cells contain North, South, North, East, and West, the result is 4. The ampersand joins the operator criterion to the value in D1, so changing D1 changes what is excluded.

SUMIF applies a criterion to one range and adds corresponding values from another. With statuses in A2:A5 (Open, Closed, Pending, Closed) and amounts in B2:B5 (100, 60, 40, 80), enter =SUMIF(A2:A5,"<>Closed",B2:B5) in C2. The result is 140: it adds 100 and 40, the amounts whose statuses are not Closed. The ranges must line up so each status is paired with its amount.

Test whether a cell differs from a blank

A comparison with an empty text string is useful when a formula should respond only after a cell has an entry. With A2 as the cell to check, enter =A2<>"" in B2. If A2 is genuinely empty, the result is FALSE; if A2 contains the number 0 or ordinary text, the result is TRUE. The empty string is represented by two quotation marks with nothing between them.

This is not quite the same as testing whether a cell looks empty on screen. A cell may contain a formula that returns an empty string, or it may contain spaces that are difficult to see. Such cells can appear blank while still containing a formula or text. If an unexpected result appears, select the cell and inspect the formula bar; removing stray spaces or adjusting the formula that produces the apparent blank may be necessary.

Also distinguish “not equal to blank” from “not equal to zero.” Zero is a numeric value, not an empty string. A cell holding 0 passes the test against "", as the example above shows. Choose the comparison that matches the data rule you actually mean rather than treating blank cells and zeros as interchangeable.

Highlight unequal values with conditional formatting

You can use <> to highlight differences visually instead of displaying TRUE or FALSE in a helper column. Select the cells to format, then choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter a formula that evaluates to TRUE for the rows or cells you want highlighted, choose a format, and confirm the rule.

For example, to highlight A2:D20 whenever the values in columns B and C differ on that row, select A2:D20 and use =$B2<>$C2 as the rule formula. The dollar signs lock the comparison to columns B and C, while the row number remains relative. Excel evaluates the rule for each selected row, so the next row is checked against B3 and C3, then B4 and C4, and so on.

Conditional formatting formulas do not need to display their TRUE or FALSE result in a worksheet cell. Their purpose is to decide whether the selected format applies. If nothing highlights, check that the selected range begins on the same row used in the formula, that the references point to the intended columns, and that the rule is enabled and has a visible format. On Mac, the Conditional Formatting controls are also on the Home tab, though the dialog layout can differ from Windows.

Common mistakes and troubleshooting

  • Using the wrong character: Excel formulas require <>, not ≠ or !=. Replace the symbol with the less-than and greater-than characters.
  • Leaving out the formula’s initial equals sign: A worksheet formula normally begins with =. Without it, Excel may treat the entry as text instead of calculating a comparison.
  • Forgetting quotation marks around text: Use a quoted text value such as "Closed" in a formula or criteria. A cell reference, by contrast, is written without quotation marks.
  • Entering a formula into a Text-formatted cell: Excel may display the formula rather than calculate it. Change the cell’s number format to General, then re-enter the formula. If the entry has a leading apostrophe, remove it as well.
  • Comparing values that only look alike: A number stored as text, extra spaces, or a formula returning an empty string can lead to results that surprise you. Inspect the underlying cell contents and, where appropriate, clean or convert the data before comparing.
  • Using the wrong argument separator: The examples here use commas, as in standard English-language Excel syntax. Depending on regional settings, Excel may expect semicolons between function arguments. If Excel rejects a function formula, check the list separator used by your installation.

When checking a formula, start with a small pair of known values in separate cells and confirm that the comparison returns the expected TRUE or FALSE. Once that basic test works, add IF, COUNTIF, SUMIF, or conditional formatting. Building the logic in stages makes it easier to tell a syntax problem from a data-quality issue.

Frequently Asked Questions

Does Excel use != for not equal?
No. Excel’s comparison operator is <>. The != form is used in some other programming languages, but it is not the standard not-equal operator in an Excel worksheet formula.

Can I type the ≠ symbol in an Excel formula?
Not as a replacement for the comparison operator. Use <> to compare values. The character ≠ can be included as display text, but it does not perform an Excel comparison.

Does Excel treat uppercase and lowercase text as different?
Ordinary comparisons such as <> are not case-sensitive. If capitalization must count as a difference, use the case-sensitive EXACT function and apply NOT to its result.

How do I check whether a cell is not blank?
Compare it with an empty string using <>"". Remember that a cell containing a formula that displays nothing, or text made of spaces, may look blank without being genuinely empty.

Can I use not equal inside COUNTIF?
Yes. Put the operator in the quoted criteria, such as "<>Closed" to count entries other than Closed. To compare against a value stored in another cell, join the operator text to that cell reference with the ampersand.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

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

Spotted an error in this guide? Let us know.