EXACT
Return TRUE only when two pieces of text match exactly, capitalisation and all.
Syntax
EXACT(text1, text2) | Argument | Required | Description |
|---|---|---|
text1 | Required | The first value. |
text2 | Required | The second value. |
Examples
Every example below was executed against VisiGrid engine 0.31.0 — not
transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.
| Formula | Result | Notes |
|---|---|---|
=EXACT("a","a") | TRUE | |
=EXACT("a","A") | FALSE | The = operator would call these equal; EXACT does not. |
=EXACT("Bo","Bo ") | FALSE | A trailing space is a difference, which makes this a whitespace detector. |
=EXACT(1,"1") | TRUE | Both arguments become text first, so the number and the string agree. |
Why not just use =
Because = ignores case. "BO" = "bo" is TRUE, and for most comparisons that
is the helpful answer. When it is not — passwords, codes, case-significant
identifiers, checking that a value was copied rather than retyped — EXACT is
the one that notices.
Numbers become text first
EXACT compares text, so a number argument is converted before the comparison
happens — EXACT(1,"1") is EXACT("1","1"), which is TRUE.
That is coercion at the boundary rather than a statement about whether 1 and
"1" are the same value. If what you want is to test that two cells hold the
same type as well as the same characters, EXACT is not that test; compare
ISTEXT or ISNUMBER alongside
it.
Finding invisible differences
Two cells that look identical and refuse to match are the classic spreadsheet
mystery. EXACT narrows it down in one step, and LEN
finishes the job:
=EXACT(A1, B1) → FALSE
=LEN(A1) → 4
=LEN(B1) → 2
Now you know it is padding rather than case, and TRIM is
the fix. See why a lookup fails for the rest of
that hunt.
Excel compatibility
Matches Excel for text comparison. Excel's EXACT is specified as comparing text and coerces its arguments first, which makes EXACT(1,"1") TRUE in both.