Operators

Not equal to (<>)

Matches all 5 recorded answers

Recorded: 5 workbook cells. How we measure this · See the Rust code

No local names are recorded for this entry.

What it does

value1 <> value2

A <> B returns TRUE when the operands are not equal under Excel's comparison rules, and FALSE when they are.

The spelling is <>, not != and not ≠. Excel's grammar admits only the two-character form.

Arguments

PositionNameMeaning
0ALeft operand. Required.
1BRight operand. Required.

Arity is exactly 2; no optional arguments, no defaults. Symmetric in value, but the operand positions still set broadcast orientation for array operands.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

  • Different kinds. Always TRUE, by the kind-ordering rule. A number is never equal to text that looks like it, so it is always unequal to it.
  • Blank operands. The context-sensitive blank rule of the family applies: blank behaves as 0 against a number, "" against text, FALSE against a logical. A blank cell is therefore not unequal to 0 and not unequal to "", though 0 <> "" is TRUE. Testing "is this cell empty?" with <>"" is consequently not a test for emptiness — it is a test that is also satisfied by numeric zero in the blank case, and ISBLANK is the function that means what the reader intended.
  • Arrays. Ordinary broadcast, #N/A for coordinates neither operand supplies.
  • Errors. Propagate; see above.

Errors

ErrorCondition
any incoming errorPropagates unchanged, so A<>B is not guaranteed to be the logical negation of A=B.
#N/AInside an array result only: a coordinate neither operand supplies.

data/functions/FUNC.OP_NOT_EQUAL.json records no Microsoft documentation URL (docs is null).

How to implement

Notes for implementers

  • Implement <> as the negation of the same equality routine = uses, not as an independently written inequality. Two routines drift; one cannot.
  • Negate after the error check, never before. The error lane must short-circuit to the error value, or the operator will report TRUE for comparisons involving errors.
  • In the array case, negate per coordinate, leaving #N/A padding as #N/A rather than turning it into TRUE.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

<> infix · 1 lines · calc-func/src/catalogue/comparison.rs on GitHub
CatalogueEntry::operator(NOT_EQUAL, "<>", Notation::Infix, VALUES, not_equal)
not_equal · 12 lines · calc-func/src/catalogue/comparison.rs on GitHub
fn not_equal(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    compare(
        NOT_EQUAL,
        arguments,
        services,
        Want::Equality,
        Ordering::is_ne,
    )
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • FUNC.OP_EQUAL — the rules this page inherits.
  • NOT — NOT(A=B) and A<>B agree on values and differ in error handling only in that NOT will itself propagate the error it receives; both are error-transparent, but the rewrite is worth stating deliberately rather than assuming.
  • COUNTIF(range,"<>"), COUNTIFS, SUMIF — the criteria mini-language, where the bare string "<>" conventionally means "not empty". That is a criteria-parser convention belonging to those functions, not a use of this operator, and its rules differ.
  • EXACT — for case-sensitive difference, NOT(EXACT(a,b)) rather than <>.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents