Let’s look at the following Xlookup equation to compare text in Excel.
=XLOOKUP(value to look up, range to look in, return value column, [match mode], [search mode])
In this formula, value to look up is the text you want to compare, range to look in is the range of cells containing the text you want to compare to, return value column is the column that contains the values you want to return if a match is found, and match mode and search mode are optional parameters that determine the behavior of the formula.
Here is an example:
In this example, the value to look up is “apple”, the range to look in is A1:B10, and the return value column is the second column (B), with a match mode of 0 (exact match).
Note: The Xlookup formula is only available in Excel 365 and later versions. If you are using an earlier version, you can use the VLOOKUP formula instead.