Cellwise Start free

Text function

Excel EXACT function

EXACT checks whether two texts are exactly the same, capital letters included, and returns TRUE or FALSE. The = sign ignores case, so ="kx-310"="KX-310" is TRUE; EXACT says FALSE. Use it for codes, passwords and IDs where case matters.

=EXACT(text1, text2)

Arguments

text1
The first text, cell or value.
text2
The second one. Numbers are compared as text, so EXACT(5,"5") is TRUE.

EXACT examples

Every result below was calculated from this sample sheet by the same spreadsheet engine the Cellwise app uses.

AB
1EnteredOn file
2KX-204KX-204
3kx-310KX-310
4KX-118 KX-118
5Kx-422KX-422
6KX-509KX-509

Download this sheet as an Excel practice file (.xlsx)

  1. =EXACT(A2,B2)

    Result: TRUE

    Same letters, same case: TRUE.

  2. =EXACT(A3,B3)

    Result: FALSE

    kx-310 is lower case, so EXACT returns FALSE. =A3=B3 would say TRUE.

  3. =SUMPRODUCT(--EXACT(A2:A6,B2:B6))

    Result: 2

    Counts the rows that match exactly: 2. A4 has a trailing space and A3 and A5 differ in case.

  4. =XMATCH(TRUE,EXACT(B2:B6,"KX-310"))

    Result: 2

    A case-sensitive position: EXACT turns the column into TRUE/FALSE and XMATCH finds the first TRUE, 2.

How to use EXACT

  1. Click the cell for the result.
  2. Type =EXACT( then the first cell, a comma and the second cell.
  3. Close the bracket and press Enter.
  4. Wrap it in IF for a label: =IF(EXACT(A2,B2),"Match","Check").

Common EXACT mistakes

Invisible spaces

A trailing space makes EXACT return FALSE, as A4 shows. Compare =EXACT(TRIM(A4),B4) if spaces do not matter.

Expecting = to check case

= and COUNTIF ignore case. Only EXACT, FIND and a few others are case-sensitive.

Comparing formatted numbers

EXACT looks at the value, not what the cell shows. 5 formatted as $5.00 is still EXACT to "5".

EXACT FAQ

How do I compare two cells with case in Excel?

Use =EXACT(A2,B2). It returns TRUE only when both texts match letter for letter, upper and lower case included.

Is Excel’s equals sign case-sensitive?

No. ="abc"="ABC" is TRUE. Use EXACT when case matters.

How do I count case-sensitive matches?

COUNTIF ignores case, so use =SUMPRODUCT(--EXACT(A2:A6,"KX-204")) to count cells that match exactly.

How do I do a case-sensitive lookup?

=INDEX(A2:A6,XMATCH(TRUE,EXACT(B2:B6,"KX-310"))) finds the row whose code matches exactly and returns the value next to it.

Related functions

Updated