Compare two text strings
=EXACT(text1, text2)
| Parameter | Description |
|---|---|
text1 |
The first text string to compare. |
text2 |
The second text string to compare. |
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
=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 fun
=SUMPRODUCT(--EXACT(value,range))