This article explains how to compare two cells of text string value. There are two easy ways to compare the cells having text strings in excel.

**Using EXACT function**

This function compares two text strings and returns TRUE if they are exactly equal, FALSE otherwise.

**EXACT** function does case sensitive comparison/match i.e. it treats Why and why as two different strings and returns FALSE

**Syntax**: EXACT(string1, string2)

Examples:

suppose A1 = “hi”, B1 = “hi”, A2 = “hello”, B2= “Hello” then

= EXACT(A1,B1) returns TRUE

= EXACT(A2,B2) returns FALSE since B2 has capital H

**Using IF(string1=string2, “equal”, “not equal”) function**

This function is not case sensitive and also it is useful if you want to print your custom return values.

Examples:

Suppose A1 = “Hey”, B1 = “hey”, A2 = “bye”, B2=”bye”, A3 = “byee”

=IF(A1=B1,”equal”,”not equal”) returns **equal**

=IF(A2=B2, “MATCH”, “NO MATCH”) returns **MATCH**

=IF(B2=A3, “MATCH”, “NO MATCH”) returns **NO MATCH**