Text
EXACT
Definition
EXACT returns TRUE when two text values match, including case, and FALSE otherwise.
Syntax
=EXACT(text1, text2)
Arguments
| Argument | Meaning |
|---|---|
text1 |
The first text, or the cell holding it. |
text2 |
The second text to compare with the first. |
Worked example
A map sheet checks whether a typed code matches a stored code. Stored codes are in A2:A4 and typed codes are in B2:B4.
| A: Stored | B: Typed |
|---|---|
| North | north |
| East | East |
| West | west |
Formula: =IF(EXACT(A2,B2),1,0)
Result: 0. North and north differ in case, so EXACT is false and IF returns 0. Filled down, the formula gives 0, 1, and 0.
Practice
Cell A2 holds Hi and cell B2 holds Hi. In C2, write a formula that returns 1 when those two cells match exactly, and 0 otherwise.
- In C2, write an IF formula that uses EXACT and shows 1 when A2 and B2 match, and 0 otherwise.
- C2 should show the result for Hi and Hi.
Related functions
VALUE converts numeric text before you compare. LEFT can take a prefix if you only need part of the string to match.
Common mistake
Using A2=B2 for a case-sensitive check: Excel's = ignores case, so North and north count as equal unless you use EXACT.