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: