Excel function

EXACTfunction

Checks whether two texts are exactly the same, case included.

All versions
=EXACT("Excel", "excel")

text15 chars

1E
2x
3c
4e
5l

text25 chars

1e
2x
3c
4e
5l

Change the second text to "Excel" and it becomes TRUE. Even one trailing space makes it FALSE. Try breaking it on purpose to see the errors.

Result

FALSE

text1

The first text to compare.

text2

The second text to compare. Case and spaces must match for TRUE.

What is the EXACT function?

=EXACT(text1, text2)

EXACT compares two texts and returns TRUE if they are exactly the same, FALSE otherwise. Any difference in case or spaces makes it FALSE.

Comparing with = says "Excel" and "excel" are equal, but EXACT says they differ. Play the steps to see the two texts lined up character by character, stopping at the first difference.

Arguments

text1
The first text or cell to compare.
text2
The second text or cell to compare.

EXACT examples

  1. Example 1. Case-sensitive

    =EXACT("Excel", "excel")

    FALSE. ="Excel"="excel" is TRUE.

  2. Example 2. The same text

    =EXACT("word", "word")

    TRUE.

  3. Example 3. A space difference

    =EXACT("word", "word ")

    One trailing space makes it FALSE.

Common mistakes

FAQ

Can it compare numbers?
Yes. Numbers are compared as text, so EXACT(123, "123") is TRUE.
Ignoring case?
Use =A1=B1.