EXACT function
EXACT compares two pieces of text and returns TRUE only if they are identical, including upper and lower case. It is useful for validating codes or case-sensitive IDs.
Example
Read it as a sentence: check whether F1, which is empty, matches empty text exactly, which gives TRUE.
Excel shows TRUE
F
1
Data
Syntax
EXACT(text1, text2)
-
text1(required) - The first text.
-
text2(required) - The second text.
Returns: TRUE if the two are identical, including case; otherwise FALSE.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=EXACT("a","A") | FALSE | Case differs |
=EXACT("a","a") | TRUE | Same |
=EXACT(1,"1") | TRUE | Number vs text |
=EXACT(TRUE,"TRUE") | TRUE | Bool vs text |
=EXACT("a ","a") | FALSE | Trailing space |
=EXACT(Data!F1,"") | TRUE | Blank vs empty text |
=EXACT(Data!F1,Data!F8) | TRUE | Blank vs formula "" |
=EXACT(Items!B2:B4,"Briar pipe") | FALSE | Range spills |
The Data sheet these formulas read
A cell that starts with = holds that formula.
F
1
2
'123
3
2024-02-29
4
TRUE
5
=1/0
6
Hello World
7
0
8
=""
Data
The Items sheet these formulas read
B
1
Item
2
Boxer cartridge
3
Briar pipe
4
Candle
Items
Watch out for
- Trailing spaces make strings differ.
- Formatting is ignored; only the underlying text is compared.
Where it works
- Excel
- EXACT is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Text functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .