Excel Formula Not Equal To

This guide treats “excel formula not equal to” the way busy spreadsheet users actually want it: answer first, then the reasoning. It is written for Excel but calls out every place Google Sheets differs, and the platform toggle at the top switches all shortcuts between Windows and Mac so nothing here assumes the keyboard you are not on.

Exact answer

In Excel: the operator is <>, as in =IF(A2<>B2,"different","same"); inside COUNTIF and SUMIFS it becomes a text criterion, "<>West", or "<>"&E2 when comparing against a cell.

On this page7
Annotated stepsExcel
1

In a plain formula, write the comparison directly: =A2<>B2 returns TRUE when they differ.

2

Wrap it in IF when you want words rather than TRUE and FALSE.

3

In a criteria argument, put the operator inside quotes: "<>0", "<>West".

4

Join a cell reference with &: "<>"&E2 — writing "<>E2" compares against the literal text E2.

5

For a case-sensitive test, use =NOT(EXACT(A2,B2)) instead of <>.

=IF(A2<>B2,"different","same")
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

Excel writes not-equal as the two angle brackets <>, not as != or =/=. In a formula it compares two values and returns TRUE or FALSE. In the criteria argument of COUNTIF, COUNTIFS, SUMIF, SUMIFS and AVERAGEIF the same operator has to be written inside a text string, and joined to a cell reference with & when the comparison value lives in a cell. The comparison ignores letter case, so EXACT is the tool when case matters. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel formula not equal to”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

=COUNTIF(B2:B200,"<>West") counts every row whose region is not West. To compare against a cell instead, =COUNTIF(B2:B200,"<>"&E2). And =SUMIFS(C2:C200,B2:B200,"<>"&E2) totals the amounts for every region except the one named in E2. The operator itself is trivial; the criteria-string form is where it goes wrong, and a COUNTIF that quietly matches nothing returns a plausible zero rather than an error. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “excel formula not equal to” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Typing != or =/=, neither of which Excel recognises.
  • Writing "<>E2" and quietly counting rows that differ from the two-character text E2.
  • Expecting <> to distinguish "west" from "West"; it does not, and EXACT is needed.
  • Comparing an empty cell with 0 — they test as equal, so a blank passes a "<>0" filter differently than expected.

Frequently asked questions

How do I write not equal to in Excel?

Use <>. For example =IF(A2<>"","filled","empty").

How do I count cells that are not blank?

=COUNTIF(A2:A200,"<>") counts every cell that contains something, and COUNTA does the same job more directly.

How do I use not-equal against a cell in COUNTIF?

Concatenate the operator and the reference: "<>"&E2.

Is it case sensitive?

No. Use =NOT(EXACT(A2,B2)) when case matters.

Other ways people ask this

People reach this page typing “excel not equal formula”, “excel formula for not equal to”, “excel formulas not equal” and “excel formula not equals”, among other phrasings; whichever wording you used, the fix above is the one you want.

Why do people search for this in so many different ways?

Because the same task has many names. “excel not equal formula”, “excel formula for not equal to”, “excel formulas not equal” all point at the one operation explained on this page, which is why they all lead here.