To use XLOOKUP
with logical criteria, you can create a separate column with the logical values and then use XLOOKUP
to search for the matching value in that column.
A B C
Name Salary Highest_Salary
John 5000 FALSE
Jane 6000 FALSE
Jim 7000 FALSE
Jack 8000 FALSE
Jill 9000 TRUE
Jerry 10000 TRUE
=XLOOKUP(TRUE, C2:C7, A2:A7)
- Create a logical column: To use logical criteria with
XLOOKUP
, you need to first create a separate column in your data range that contains the logical values (i.e. TRUE or FALSE). For example, you can create a column that checks if the values in a certain column are greater than a certain value. - Use
XLOOKUP
to search for the matching value: Once you have created the logical column, you can then useXLOOKUP
to search for the value in the desired column (e.g. names) that corresponds to the logical value you are searching for. The first argument in theXLOOKUP
formula should be the logical value you are searching for (e.g.TRUE
), the second argument should be the range that contains the logical values (i.e. the logical column), and the third argument should be the range that contains the values you want to return (e.g. names).
In this example, the XLOOKUP
formula returns the value Jerry
, which is the name of the person with the highest salary. The formula is searching for the logical value TRUE
in column C, which corresponds to the highest salary in column B.