XLOOKUP
Searches a range or an array, and then returns the item corresponding to the first match it finds. If no match exists, XLOOKUP can return the closest (approximate) match.
Syntax
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Parameters
- lookup_value: Required. The value to search for
- lookup_array: Required. The array or range to search
- return_array: Required. The array or range to return
- if_not_found: Optional. Value to return if no match is found
- match_mode: Optional. 0=exact match (default), -1=exact or next smaller, 1=exact or next larger, 2=wildcard match
- search_mode: Optional. 1=first-to-last (default), -1=last-to-first, 2=binary ascending, -2=binary descending
Example
=XLOOKUP("Smith", A:A, B:B, "Not found")