To check if two values in Excel are not the same, use the ≠ operator (written as <> in formulas). This returns TRUE if values differ and FALSE if they match. No add-ins or special tools are needed—just Excel's built-in comparison operators.

What You'll Need

  • Microsoft Excel (any modern version: Excel 2010 or newer, Microsoft 365, or Excel Online)
  • A cell containing data you want to compare
  • Another cell or value to compare against
  • Basic familiarity with entering formulas (e.g., starting with =)

Step-by-Step

  1. Open your Excel workbook and navigate to the worksheet where you want to perform the comparison.
  2. Click the cell where you want the result (TRUE/FALSE) to appear—this will hold your "not equal" formula.
  3. Type = to begin the formula.
  4. Enter the first value or cell reference. For example, type A1 if comparing cell A1, or type "Apple" (including quotes) for a literal text string.
  5. Type the not-equal operator: <> (press Shift+< for <, hold Shift, press , (comma), then type >). This is Excel’s standard "not equal" symbol—never use != or ≠ directly in formulas.
  6. Enter the second value or cell reference. For example, B1 or "Orange".
  7. Press Enter. Excel evaluates the expression and displays TRUE if the values differ, or FALSE if they match. For instance, =A1<>B1 returns TRUE when A1 contains "Red" and B1 contains "Blue".

Common Mistakes

  • Using the wrong operator: Typing != (common in programming) or ≠ (the mathematical symbol) will cause a #NAME? error because Excel does not recognize them in formulas.
  • Missing quotes around text: Comparing text without quotes—e.g., =A1<>Apple—triggers an error. Always use double quotes: =A1<>"Apple".
  • Ignoring hidden characters: Extra spaces, non-breaking spaces, or invisible characters (e.g., line breaks from copy-paste) can make identical-looking values unequal. Use TRIM() or SUBSTITUTE() to clean data first.
  • Case sensitivity: Excel’s <> is case-insensitive for text. "Apple" and "apple" are treated as equal, so ="Apple"<>"apple" returns FALSE. If case matters, use =EXACT(A1,B1) and wrap it in NOT().
  • Combining with logical functions incorrectly: Writing =IF(A1<>B1,TRUE,FALSE) is redundant—just use =A1<>B1 directly. Over-complexity can hide errors.

Tips

  • Combine with IF for custom messages: Use =IF(A1<>B1,"Mismatch","OK") to show user-friendly feedback instead of TRUE/FALSE.
  • Check for missing data: Use =A1<>"" to detect non-empty cells. An empty string "" represents a truly blank cell.
  • Use with COUNTIF/SUMIF: In COUNTIF(range,"<>0"), the criteria exclude zeros. Note: the formula must be written as a string inside quotes, so use "<>0" (not <>0).
  • Test with conditional formatting: Select a range > Home > Conditional Formatting > New Rule > Use a formula > enter =A1<>$B$1 > set a fill color. This highlights cells that differ from a reference.
  • Verify with F9: Highlight part of a formula (e.g., A1<>B1) and press F9 to see its evaluated result before finalizing the formula.

Troubleshooting

If your "not equal" formula isn’t working as expected, follow these steps:

  1. Check for typos in the operator: Re-type <> manually—copy-pasting can sometimes insert invisible or incorrect characters.
  2. Ensure consistent data types: Comparing text to a number (e.g., ="5"<>5) will return TRUE even if visually similar. Format cells consistently or convert types using VALUE() (text to number) or TEXT() (number to text).
  3. Inspect for whitespace: In adjacent cells, use =LEN(A1) and =CODE(MID(A1,1,1)) to check length and the first character’s code. Use =TRIM(CLEAN(A1)) to strip extra spaces and non-printable characters before comparing.
  4. Confirm cell references: Double-check that A1, B1, etc., point to the intended cells. A dragged formula may reference the wrong row/column (e.g., =A2<>B1 instead of =A2<>B2).
  5. Test with simple values: Enter "X" in A1 and "Y" in B1. If =A1<>B1 returns FALSE, your data or formula has an issue. If it returns TRUE, the problem lies in your original data.
  6. Check for merged cells or hidden rows: Merged cells can cause unexpected behavior in formulas. Unmerge and re-enter data if needed.

Frequently Asked Questions

Can I use "not equal" with dates in Excel?

Yes. Excel stores dates as serial numbers, so =A1<>B1 works directly. For example, =DATE(2024,1,1)<>DATE(2024,1,2) returns TRUE. Ensure both cells use the Date format to avoid text misinterpretation.

Why does my formula show the formula text instead of the result?

The cell is formatted as Text. Select the cell(s), change the format to General (Home tab > Number group > dropdown), then press F2 and Enter to re-enter the formula.

How do I compare multiple cells for inequality at once?

Use =OR(A1<>B1, A1<>C1, A1<>D1) to return TRUE if A1 differs from at least one other cell. For all comparisons to differ, use =AND(A1<>B1, A1<>C1, A1<>D1).

Can I use "not equal" in a filter?

Yes. Apply a filter (Data > Filter), click the dropdown arrow on a column header, go to Text Filters (or Number Filters) > Does Not Equal, and enter the value to exclude. This removes rows where the cell equals that value.

Why does "Apple" not equal "apple" in my comparison?

It does—Excel ignores case in comparisons. If ="Apple"<>"apple" returns TRUE, check for hidden characters, fonts, or that you didn’t accidentally type a different Unicode character (e.g., a Cyrillic "а"). Use =EXACT("Apple","apple") to confirm case sensitivity.

Is there a limit to how many "not equal" comparisons I can chain?

No hard limit exists beyond Excel’s 8,192 characters per formula. However, readability and performance degrade with very long formulas. Break complex logic into helper columns for reliability.