A < B returns TRUE when A precedes B in Excel's comparison order, and FALSE
otherwise.
The three shared comparison rules are stated in full on
FUNC.OP_EQUAL. This operator is where the first of them stops being an
abstraction, because ordering across kinds is only observable through the strict
inequalities:
any Number < any Text < any Logical
Within a kind:
Numbers order numerically, but through the family's normalization lane rather than
exact IEEE comparison — the contract records =0.1+0.2<0.3 as FALSE, which exact
arithmetic would make TRUE. See FUNC.OP_EQUAL rule 3.
Text orders by a case-insensitive comparison. The collation beyond that — accents,
non-Latin scripts, locale-specific sequences — is explicitly out of the contract's slice,
and the Handbook has measured only the cases in FN-OP_EQUAL-001, FN-OP_LESS_THAN-001 and
FN-SORT-001.
Logicals order FALSE before TRUE.
Arguments
Position
Name
Meaning
0
A
Left operand: the candidate lesser value. Required.
1
B
Right operand: the candidate greater value. Required.
Arity is exactly 2; no optional arguments, no defaults. Order is load-bearing — this is the
first comparison page where swapping operands changes the answer.
Try it
Quirks
Result and edge cases
Equal operands give FALSE; < is strict.
Different kinds give the kind ordering, always, with no numeric interpretation of text.
Blank operands. The context-sensitive blank rule applies: blank behaves as 0 against
a number, "" against text, FALSE against a logical. So a blank cell is not less than
zero, and is not less than "" — but it is less than any positive number and less than
TRUE.
Text ordering of numeric strings."10" < "9" is TRUE under text ordering while
10 < 9 is FALSE; the difference is entirely in whether the operands are text. Sorted
columns of numbers stored as text are the standard way this reaches a real workbook.
Arrays. Ordinary broadcast with #N/A for unsupplied coordinates.
Errors
data/functions/FUNC.OP_LESS_THAN.json records no Microsoft documentation URL (docs is
null).
Conjoining Hangul jamo do not compare equal to the precomposed syllable
U+1100 U+1161 is canonically equivalent to the syllable U+AC00 in Unicode, but Excel's comparison says they are not equal, and the jamo sequence sorts first. The same holds with a final consonant, U+1100 U+1161 U+11A8 against U+AC01.
Formula
Excel
Mathematical value
="가"="가" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
FALSE
—
="가"<"가" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="각"="각" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Punctuation before a Japanese repeat mark sorts one way after a Latin letter, the other after Han
Comparing a string with punctuation before a repeat or prolonged-sound mark against the same string without the punctuation, the order depends on the character at the start. After a Latin letter the punctuated string is smaller: "a-ゝx" < "aゝx". After a Han character it is larger: "時-ゝx" > "時ゝx". This held for every pair read, with the marks ゝ, 々 and ー and with hyphen-minus, U+2212 and U+2019 as the punctuation. In all 66 readings the two strings are never equal, and a string with the mark added sorts after the string without it, after Latin and after Han alike: "a−ゝ" > "a−".
Formula
Excel
Mathematical value
="a-ゝx"<"aゝx" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="a-ゝx">"aゝx" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
FALSE
—
="時-ゝx"<"時ゝx" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
FALSE
—
="時-ゝx">"時ゝx" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="a−ゝ"<"aゝ" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="時−ゝ">"時ゝ" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="a−ゝ">"a−" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="時−ゝ">"時−" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
A Han iteration mark is not read as a repeat of the character
In text comparison and SORT, after a Han character the iteration mark 々 sorts before Latin letters and before the doubled character: 時 < 時々 < 時a < 時b < 時時. Latin letters sort before Han here, and 時々 is not treated as 時時.
Formula
Excel
Mathematical value
="時々"<"時時" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
="時々"<"時a" Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
TRUE
—
=TEXTJOIN("|",FALSE,SORT({"時々";"時時";"時";"時a";"時b"})) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Implement one comparison core returning a three-way result (less, equal, greater, plus an
error lane), and derive all six operators from it. Six independent implementations will
disagree somewhere, and the disagreement will be invisible until a user finds it.
The kind ordering must be applied before any within-kind comparison, and must be total.
Case-insensitive text comparison and locale collation are not the same problem. Record
which one you implemented; the contract's own slice stops at the installed baseline.
Do not reduce A<B to NOT(A>=B) in the presence of errors — the error must reach the
result, not become a logical.
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.
FUNC.OP_GREATER_THAN — the mirror. A<B and B>A should
agree; that they do is an assumption worth testing rather than a theorem.
FUNC.OP_EQUAL — the rules; also the third leg of trichotomy.
MIN, SMALL, SORT, RANK — functions that order values. They do not necessarily use
this operator's rules; MIN over a range ignores text entirely, where < ranks it above
every number. Do not reason from one to the other.
MATCH with match type 1 or -1, and VLOOKUP/HLOOKUP in approximate mode, depend on
a data ordering that must agree with the comparison ordering. Mixed-kind columns are where
that assumption breaks.
COUNTIF(range,"<5") — criteria strings again: parsed by the consuming function, not this
operator.