Xlookup improvement suggestion

Copper Contributor

The Xlookup function is great but it would be even better if it allowed the 3rd argument to be a literal value or reference to a single cell. This would allow it to be used to answer the question "Does this value exist in that list?" without having to wrap it in an if statement.

 

Rather than:

=if(xlookup(A1, B1:B10, B1:B10, "") > "", "Yes", "No")

 

We could do things like:

=xlookup(A1, B1:B10, "Yes", "No")

=xlookup(A1, B1:B10, true, false)

=xlookup(A1, B1:B10, C1, D1)

 

 

2 Replies

@Dave_Hodgman 

Actually you would use COUNTIF() for such a task.

 

No I wouldn't. I would still have to wrap countif() in an if statement to get the result I want.

Perhaps a better way of stating the question is - "If this value exists in that list, then evaluate this literal or cell, else evaluate that literal or cell". This could be achieved in one simple xlookup call with the enhancement I've suggested.