Google Sheets NE Function: Syntax, Examples & Tips

Returns TRUE if two values are not equal and FALSE if they are; the function form of the <> operator.
Google Sheets
=NE(value1, value2)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What Is NE?
  3. How NE Relates to the <> Operator
  4. Basic Examples
  5. How Sheets Compares Different Kinds of Values
  6. Common Use Cases
  7. Using NE with Arrays
  8. Common Errors
  9. Tips and Best Practices
  10. Related Functions
  11. Example use case

Parameters

ParameterRequiredDescription
value1YesThe first value to compare.
value2YesThe value to test for inequality with value1.

What Is NE?

NE is the function form of the <> comparison operator in Google Sheets. It takes two values and returns TRUE if the first value does not equal the second, and FALSE otherwise. Writing =NE(A2, B2) gives exactly the same result as writing =A2<>B2.

Most people reach for the operator because it is shorter, but the function form has its place. It reads clearly when you are nesting logic, it can be easier to explain to colleagues who are not comfortable with symbols, and it is what Sheets itself uses internally when it describes the operator in help tooltips and error messages.

How NE Relates to the <> Operator

Google Sheets maps each comparison operator to a named function:

FunctionOperatorReturns TRUE when
EQ=value1 equals value2
NE<>value1 does not equal value2
GT>value1 is greater than value2
GTE>=value1 is greater than or equal to value2
LT<value1 is less than value2
LTE<=value1 is less than or equal to value2

There is no difference in behaviour between NE and <>: same type rules, same blank handling, same results. Pick whichever makes the formula easier to read.

Basic Examples

Flag changed values

Google Sheets
=NE(B2, C2)

Returns TRUE when this month's value in B2 differs from last month's in C2.

Exclude a placeholder

Google Sheets
=NE(A2, "N/A")

Returns TRUE for every row where A2 is anything other than "N/A" (in any capitalisation).

Check that a cell is not zero

Google Sheets
=NE(D2, 0)

Returns TRUE if D2 holds a non-zero value. Note that a blank D2 counts as 0 and returns FALSE.

How Sheets Compares Different Kinds of Values

The comparison functions follow exactly the same rules as their operators, so it helps to know them:

  • Numbers are compared numerically. Dates and times are stored as serial numbers, so they compare chronologically.
  • Text is compared alphabetically and without regard to case — "apple" and "APPLE" are treated as equal.
  • Mixed types do not raise an error. Google's documentation doesn't spell out how text ranks against numbers, so a number stored as text (for example "100" typed with a leading apostrophe or imported from a CSV) can produce a surprising answer.
  • Blank cells behave like 0 in a numeric comparison and like an empty string "" in a text comparison.
  • Errors propagate: if either argument is an error such as #N/A, the result is that error.

Common Use Cases

  • Change tracking: Compare a current snapshot to a previous one and flag what moved.
  • Exception reports: Highlight records whose status is not "Complete".
  • Filtering: =FILTER(A2:C100, NE(B2:B100, "Cancelled")) keeps every row that isn't cancelled.
  • Audit checks: Confirm that a calculated column differs from a hard-coded fallback.

Using NE with Arrays

Like the operator, NE works element by element when wrapped in ARRAYFORMULA, which is handy for producing a whole column of TRUE/FALSE flags at once:

Google Sheets
=ARRAYFORMULA(NE(B2:B100, C2:C100))

The result can feed straight into FILTER, COUNTIF-style logic via SUMPRODUCT, or conditional formatting.

Common Errors

  • Everything returns TRUE: Usually a type mismatch — a number on one side and text on the other are never equal. Check with ISTEXT / ISNUMBER.
  • Floating-point noise: Two results that display as 0.3 may differ in the 17th decimal place. Round both values first.
  • Blank cells returning FALSE against 0: A blank equals 0 and equals "", so NE(blank, 0) is FALSE.
  • Wrong number of arguments: NE accepts exactly two.

Tips and Best Practices

  • NE is simply NOT(EQ(a, b)); use whichever reads better.
  • Text comparison ignores case. For case-sensitive inequality use =NOT(EXACT(A2, B2)).
  • In COUNTIF/SUMIF criteria the operator form is required: "<>Cancelled", not NE.
  • Combine NE with AND, OR and NOT to build multi-part tests, e.g. =AND(NE(A2, B2), C2<>"").
  • In conditional formatting custom formulas, either form works; the operator is usually shorter.

EQ, GT, GTE, LT, LTE, ISBETWEEN and IF. For counting or summing based on comparisons across a range, use COUNTIF or SUMIF with an operator criterion such as "<>100".

Example use case

An operations manager keeps last week's order statuses in column B and this week's in column C. Adding =NE(B2, C2) down column D and applying conditional formatting to the TRUE rows instantly shows which orders changed status.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.