Spreadsheet Practice

EXACT function

EXACT compares two text values and returns TRUE only if they match exactly, including upper and lower case. 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)

ArgumentRequired?What it is
text1RequiredThe first text or cell.
text2RequiredThe 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.

CellFormulaResultWhat it shows
C2=EXACT(A2,B2)TRUESame characters, same case: TRUE
C3=EXACT(A3,B3)FALSESame letters, different case: FALSE
C4=EXACT(A4,B4)FALSEA 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 fileCode enteredResult
ABc-12ABc-12TRUE
ABc-12abc-12FALSE
XR-7XR-7 FALSE

Practice EXACT

Graded instantly, then re-checked on changed data.

Case-sensitive code check

Product codes are case-sensitive. In 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 seeWhy, and how to fix it
Spaces cause FALSEEXACT counts every space. Compare TRIM(A2) with TRIM(B2) when spacing shouldn't matter.
Numbers compare as textEXACT 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.

Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.