How to Compare Text with Case Sensitivity in Excel

The = sign ignores capitalization; EXACT does not. Validate case-sensitive license keys and count exact matches in a list.

You will learn to

  • Compare two values case-sensitively with EXACT
  • Turn EXACT into a status label with IF
  • Count case-sensitive matches with SUMPRODUCT

How it works

Excel’s = operator ignores capitalization: ="Kx7-pQ2"="kx7-pq2" returns TRUE. For passwords, license keys, product codes and IDs where case matters, use =EXACT(text1, text2), which returns TRUE only when every character — including upper and lower case — matches.

COUNTIF and MATCH are not case-sensitive either. To count exact matches in a range, combine EXACT with SUMPRODUCT: =SUMPRODUCT(--EXACT(C2:C7,B9)) checks every cell and adds up the TRUEs. The double minus turns TRUE/FALSE into 1/0.

=EXACT(B2,C2)