Lookupmedium

XLOOKUP()

The modern replacement for VLOOKUP. Searches any column, returns from any column.

Syntax
fx
=XLOOKUP(search_key, lookup_range, result_range, [missing_value], [match_mode])
Arguments
ArgumentDescription
search_keyThe value to search for.
lookup_rangeThe range to search through.
result_rangeThe range from which to return a result.
Example
fx
=XLOOKUP("Acme Co", A:A, C:C, "Not found")

Paste this into Google Sheets to run it. The live playground on this site covers 24 of the 61 functions, and XLOOKUP isn't one of them yet.

Common pitfalls

  • Defaults to exact match: no need to remember FALSE. The 4th arg is the not-found return value, NOT a sort flag.
  • The 6th arg sets search direction; pass -1 to find the LAST match instead of the first.
  • Returns #N/A if not found and no default supplied. Pass an empty string or sentinel as the 4th argument.
Related formulas
VLOOKUP()
Vertical lookup. Searches the first column of a range and returns a value from a specified column.
INDEX()
Returns the content of a cell at a given row and column in a range.
MATCH()
Returns the relative position of a value in a range.
Used by
VLOOKUP()
Vertical lookup. Searches the first column of a range and returns a value from a specified column.