Excel Guides

Comparing Strings in Excel

Comparing strings in Excel can be done with a simple function. The =EXACT(A1,B1) function will return TRUE if the two cells contain the same text string. This is a case-sensitive comparison, so "apple" and "Apple" would not be considered equal.

If you need to do a case-insensitive comparison, you can use the =ISERR(SEARCH(A1,B1)) function. This will return TRUE if the text in A1 is not found in B1. Note that this is not a perfect match, as it will also return TRUE if A1 is found in B1 but is not at the beginning of the cell.

You can also compare strings by their position in a cell. The =FIND(A1,B1) function will return the position of A1 in B1, or #VALUE! if A1 is not found. You can use this to compare two cells by their position:

  • =FIND(A1,B1)=FIND(B1,A1) - returns TRUE if A1 and B1 are in the same position
  • =FIND(A1,B1)<FIND(B1,A1) - returns TRUE if A1 comes before B1
  • =FIND(A1,B2)-FIND(B2,A2)=0 - returns TRUE if A2 and B2 are next to each other

Move beyond 

Excel

Get started with Causal today.
Build models effortlessly, connect them directly to your data, and share them with interactive dashboards and beautiful visuals.