Text function
Excel EXACT function
EXACT checks whether two texts are exactly the same, capital letters included, and returns TRUE or FALSE. The = sign ignores case, so ="kx-310"="KX-310" is TRUE; EXACT says FALSE. Use it for codes, passwords and IDs where case matters.
=EXACT(text1, text2)Arguments
text1- The first text, cell or value.
text2- The second one. Numbers are compared as text, so EXACT(5,"5") is TRUE.
EXACT examples
Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | |
|---|---|---|
| 1 | Entered | On file |
| 2 | KX-204 | KX-204 |
| 3 | kx-310 | KX-310 |
| 4 | KX-118 | KX-118 |
| 5 | Kx-422 | KX-422 |
| 6 | KX-509 | KX-509 |
Download this sheet as an Excel practice file (.xlsx)
Result: TRUE
Same letters, same case: TRUE.
Result: FALSE
kx-310 is lower case, so EXACT returns FALSE.
=A3=B3would say TRUE.Result: 2
Counts the rows that match exactly: 2. A4 has a trailing space and A3 and A5 differ in case.
Result: 2
A case-sensitive position: EXACT turns the column into TRUE/FALSE and XMATCH finds the first TRUE, 2.
How to use EXACT
- Click the cell for the result.
- Type =EXACT( then the first cell, a comma and the second cell.
- Close the bracket and press Enter.
- Wrap it in IF for a label:
=IF(EXACT(A2,B2),"Match","Check").
Common EXACT mistakes
Invisible spaces
A trailing space makes EXACT return FALSE, as A4 shows. Compare =EXACT(TRIM(A4),B4) if spaces do not matter.
Expecting = to check case
= and COUNTIF ignore case. Only EXACT, FIND and a few others are case-sensitive.
Comparing formatted numbers
EXACT looks at the value, not what the cell shows. 5 formatted as $5.00 is still EXACT to "5".
EXACT FAQ
How do I compare two cells with case in Excel?
Use =EXACT(A2,B2). It returns TRUE only when both texts match letter for letter, upper and lower case included.
Is Excel’s equals sign case-sensitive?
No. ="abc"="ABC" is TRUE. Use EXACT when case matters.
How do I count case-sensitive matches?
COUNTIF ignores case, so use =SUMPRODUCT(--EXACT(A2:A6,"KX-204")) to count cells that match exactly.
How do I do a case-sensitive lookup?
=INDEX(A2:A6,XMATCH(TRUE,EXACT(B2:B6,"KX-310"))) finds the row whose code matches exactly and returns the value next to it.
Related functions
TRIMRemoves extra spacesXMATCHPosition of a value, modernSUMPRODUCTMultiply then addIFPicks a result from a test
Updated