EXACT function
Quick answer
EXACT compares two text values and returns TRUE only if they match exactly, including upper and lower case.
- Syntax
=EXACT(text1, text2)- Most common use
=EXACT(A2,B2)returns TRUE (Same characters, same case: TRUE)
The = sign and lookups ignore case, so EXACT is what you use when case matters, such as for case-sensitive product codes or IDs.
- Available in
- Every current version
- Category
- Text functions
- Returns
- TRUE if the two match character for character, otherwise FALSE.
- Google Sheets
- Works the same in Google Sheets.
Syntax
=EXACT(text1, text2)
| Argument | Required? | What it is |
|---|---|---|
text1 | Required | The first text or cell. |
text2 | Required | The text or cell to compare it with. |
Examples
Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.
| Cell | Formula | Result | What it shows |
|---|---|---|---|
| C2 | =EXACT(A2,B2) | TRUE | Same characters, same case: TRUE |
| C3 | =EXACT(A3,B3) | FALSE | Same letters, different case: FALSE |
| C4 | =EXACT(A4,B4) | FALSE | A trailing space makes them different |
Try it live
This is the sample sheet. Change any number or text, or edit a formula, and the results update.
Show the sample data as a table
| Code on file | Code entered | Result |
| ABc-12 | ABc-12 | TRUE |
| ABc-12 | abc-12 | FALSE |
| XR-7 | XR-7 | FALSE |
Practice EXACT
Graded instantly, then re-checked on changed data.
Case-sensitive code check
C2, return TRUE only if the code entered in B2 matches the code on file in A2 exactly, including case. Fill down to C6.Common mistakes
| What you see | Why, and how to fix it |
|---|---|
| Spaces cause FALSE | EXACT counts every space. Compare TRIM(A2) with TRIM(B2) when spacing shouldn't matter. |
| Numbers compare as text | EXACT converts both values to text, so EXACT(100,"100") is TRUE even though =100="100" is FALSE. |
Tips
- For a case-sensitive lookup, combine it with XLOOKUP: =XLOOKUP(TRUE,EXACT(A2:A20,D2),B2:B20).
Questions
How do I compare two cells with a case-sensitive match?
=EXACT(A2,B2) returns TRUE only when the text and the case both match. =A2=B2 ignores case.
Is Excel case-sensitive?
Mostly no: the = sign, VLOOKUP, XLOOKUP, MATCH and COUNTIF all ignore case. EXACT, FIND and SUBSTITUTE are case-sensitive.
Answers that use EXACT
In other languages
EXACT is IGUAL in Spanish Excel and IDENTISCH in German Excel. Each page has the syntax with semicolons, the examples and the exercise in that language. For other functions and languages, use the Function Translator.
Updated Checked by running: every formula on this page was run by our formula engine on .