Summary

The Excel EXACT function compares two text strings, taking into account upper and lower case characters, and returns TRUE if they are the same, and FALSE if not. EXACT is case-sensitive.

Purpose 

Compare two text strings

Return value 

A boolean value (TRUE or FALSE)

Syntax

=EXACT(text1,text2)
  • text1 - The first text string to compare.
  • text2 - The second text string to compare.

How to use 

The EXACT function compares two text strings in a case-sensitive manner. If the two strings are exactly the same, EXACT returns TRUE. If the two strings are not the same (taking into account upper and lower case) EXACT returns FALSE.

The EXACT function takes two arguments, text1 and text2, which should be valid text strings. If these values are entered directly into the function, they should be enclosed in double quotes ("").

Examples

Below are two examples of the EXACT function used with hardcoded strings. In the first example, the strings are identical, in the second example, the only difference is the capital "A":

=EXACT("apple","apple") // returns TRUE
=EXACT("Apple","apple") // returns FALSE

In the example shown, the formula in D6, copied down the column, is:

=EXACT(B6,C6)

You can also use a normal equals sign (=) in a formula, but the comparison is not case sensitive:

=("Apple"="apple") // returns TRUE

To count cells that contain specific text, taking into account upper and lower case characters, you can combine EXACT together with the SUMPRODUCT function like this:

=SUMPRODUCT(--EXACT(value,range))

Detailed explanation here.

Notes

  • The standard equals to (=) operator is not case-sensitive.
  • EXACT is meant for text values, and will convert numeric values to text.
Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.