NE function

NE returns TRUE if two values are not equal, FALSE if they match. Use it to find mismatches, filter data by inequality, or flag exceptions.

=NE(value1, value2)

Generate a NE formula

Describe what you need. The generator will reach for NE where NE is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How NE reads its arguments
value1requiredvalue2requiredNE
ArgumentRequiredDescription
value1RequiredAny value: a cell reference, number, text, or formula result. Compared as-is against value2.
value2RequiredAny value: a cell reference, number, text, or formula result. If either value is an error, NE returns that error instead of TRUE or FALSE.

Returns

A boolean: TRUE if the values differ, FALSE if they're identical.

Availability

Excel: Not available · Google Sheets: Supported

Worked examples

1. Flag high-priority support tickets for escalation

Ticket IDPriorityOpenedClosedAgentCSAT
T001High2026-09-012026-09-02Alice5
T002Low2026-09-022026-09-05Bob3
T003Medium2026-09-032026-09-04Carol4
=IF(NE(B2,"Low"),"Escalate","Standard")

Result: Escalate, Standard, Escalate

NE(B2,"Low") returns TRUE for T001 (High≠Low) and T003 (Medium≠Low), triggering "Escalate". For T002, NE returns FALSE because Priority is exactly "Low", so it shows "Standard". This pattern routes tickets by priority level without using complex nested IFs.

2. Identify tickets handled by agents other than Alice

Ticket IDPriorityOpenedClosedAgentCSAT
T001High2026-09-012026-09-02Alice5
T002Low2026-09-022026-09-05Bob3
T003Medium2026-09-032026-09-04Alice4
T004High2026-09-042026-09-06Carol2
=IF(NE(E2,"Alice"),"Other agent","Alice's ticket")

Result: Alice's ticket, Other agent, Alice's ticket, Other agent

For each row, NE compares the Agent to "Alice". When the agent IS Alice (T001, T003), NE returns FALSE and shows "Alice's ticket". When the agent differs (T002 Bob, T004 Carol), NE returns TRUE and shows "Other agent". This helps track workload distribution across your support team.

3. Find tickets that missed perfect customer satisfaction

Ticket IDPriorityOpenedClosedAgentCSAT
T001High2026-09-012026-09-02Alice5
T002Low2026-09-022026-09-05Bob3
T003Medium2026-09-032026-09-04Carol5
T004High2026-09-042026-09-06Alice2
T005Low2026-09-052026-09-07Carol4
=NE(F2,5)

Result: FALSE, TRUE, FALSE, TRUE, TRUE

NE(F2,5) returns FALSE only when CSAT is exactly 5 (T001, T003 get perfect scores). Every other CSAT—3, 2, 4—is not equal to 5, so NE returns TRUE. This flags underperforming tickets for coaching or follow-up investigations.

Common errors

Which NE error are you seeing?
NE returned an error#VALUE!
Convert both sides to matching types before comparison. Use TEXT() for dates or VALUE() for numbers: =NE(TEXT(A2,"YYYY-MM-DD"),"2026-09-01") or =NE(VALUE(E2),5).
#N/A
Wrap the lookup formula in IFNA() or IFERROR() to replace #N/A with a safe default before NE evaluates it. Example: =NE(IFNA(VLOOKUP(E2,...),"Unknown"),"Alice")
#REF!
Check that both references exist and are valid. Use the Name Manager (Data → Named ranges) to find and fix broken formulas, or manually update the cell references.
ErrorWhy it happensHow to fix it
#VALUE!Comparing values with incompatible types when NE cannot safely coerce them—for example, comparing a date stored as text ("2026-09-01") to an actual date serial number.Convert both sides to matching types before comparison. Use TEXT() for dates or VALUE() for numbers: =NE(TEXT(A2,"YYYY-MM-DD"),"2026-09-01") or =NE(VALUE(E2),5).
#N/AOne or both inputs reference a formula that returns #N/A (e.g., VLOOKUP or XLOOKUP not finding a match, or MATCH failing to locate an agent name).Wrap the lookup formula in IFNA() or IFERROR() to replace #N/A with a safe default before NE evaluates it. Example: =NE(IFNA(VLOOKUP(E2,...),"Unknown"),"Alice")
#REF!A cell reference in value1 or value2 points to a deleted row, column, or sheet—common if you've removed ticket rows or reorganized the spreadsheet.Check that both references exist and are valid. Use the Name Manager (Data → Named ranges) to find and fix broken formulas, or manually update the cell references.

Tips and when to use something else

  • NE is case-sensitive: "Alice" ≠ "alice". Clean inconsistent text with LOWER() or UPPER() if case shouldn't matter in your comparison.
  • To check equality instead, use EQ(value1,value2) or the = operator: =value1=value2 returns the opposite of NE.
  • For complex multi-condition checks, reach for SWITCH or IFS instead of nesting multiple NE calls inside each other.
  • NE coerces numeric types automatically: NE(5,"5") returns FALSE because both are treated as the number 5. Be cautious when mixing numbers and text strings.

Frequently asked questions

How is NE different from the <> operator?
They are functionally identical. In Google Sheets, =A2<>B2 and =NE(A2,B2) return the same result. NE is more explicit when used inside functions like FILTER or as an argument to other formulas, making intent clearer.
What happens if I compare a number to text that looks like a number?
NE attempts type coercion. NE(5,"5") returns FALSE because both are treated as the number 5. However, if text and number have different content (NE(5,"Bob")), NE returns TRUE. Test edge cases with your real data.
Can I use NE to compare entire columns or arrays at once?
No, NE compares only single values. To count mismatches across a range, use COUNTIF: =COUNTIF(A2:A10,"<>"&B2) counts how many cells in A2:A10 don't match the value in B2.
Is NE available in Excel, or only Google Sheets?
NE is a Google Sheets function. Excel users should use the <> operator instead: =A2<>B2 produces identical results. If migrating formulas to Excel, replace NE() with the <> syntax.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17