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
| Position | Name | Meaning |
|---|---|---|
| 0 | A | Left operand. Required. |
| 1 | B | Right 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
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
0against a number,""against text,FALSEagainst a logical. A blank cell is therefore not unequal to0and not unequal to"", though0 <> ""isTRUE. 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, andISBLANKis the function that means what the reader intended. - Arrays. Ordinary broadcast,
#N/Afor coordinates neither operand supplies. - Errors. Propagate; see above.
Errors
| Error | Condition |
|---|---|
| any incoming error | Propagates unchanged, so A<>B is not guaranteed to be the logical negation of A=B. |
#N/A | Inside 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
TRUEfor comparisons involving errors. - In the array case, negate per coordinate, leaving
#N/Apadding as#N/Arather than turning it intoTRUE.
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 GitHubCatalogueEntry::operator(NOT_EQUAL, "<>", Notation::Infix, VALUES, not_equal)
not_equal · 12 lines · calc-func/src/catalogue/comparison.rs on GitHubfn 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
comparecatalogue/comparisonOperand::kindcatalogue/comparisonOperand::blankcatalogue/comparisonordercatalogue/comparisonoverflow_numberscatalogue/comparisonnumberscatalogue/comparisonin_bandcatalogue/comparisonRounded::upcatalogue/comparisonRoundings::ofcatalogue/comparisonRoundings::disjointcatalogue/comparisontextscatalogue/comparisoncomparecatalogue/comparison/collationweighedcatalogue/comparison/collationmeasured_iteration_extensioncatalogue/comparison/collationtablecatalogue/comparison/sort_keydecode64catalogue/comparison/sort_keyReader::bytecatalogue/comparison/sort_keyReader::varintcatalogue/comparison/sort_keyReader::donecatalogue/comparison/sort_keyin_rangescatalogue/comparison/sort_keybuildcatalogue/comparison/sort_keyhan_basecatalogue/comparison/sort_keyderivecatalogue/comparison/sort_keyshared_jamo_tailscatalogue/comparison/sort_keyordinary_jamo_prefixcatalogue/comparison/sort_keyindependent_jamo_suffixcatalogue/comparison/sort_keyjamo_leading_primarycatalogue/comparison/sort_keyleading_ordercatalogue/comparison/sort_keyBefore::separate_specialcatalogue/comparison/sort_keyGathered::kanacatalogue/comparison/sort_keyGathered::unitcatalogue/comparison/sort_keypartscatalogue/comparison/sort_keydiacritic_ordercatalogue/comparison/sort_keydiacriticscatalogue/comparison/sort_keylow32decimalNatural::from_u64decimalNatural::pow10decimalNatural::normalizedecimalNatural::is_zerodecimalNatural::mul_add_smalldecimalNatural::times_pow10decimalNatural::times_pow5decimalNatural::times_pow2decimalExactDecimal::binarydecimal
Argument and result plumbing
CatalogueEntry::operatorcatalogueoperandcoerce
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)andA<>Bagree on values and differ in error handling only in thatNOTwill 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