Back to Functions

XLOOKUP

Returns the values in the result range based on the position where a match was found in the lookup range. If no match is found, it returns the closest match.

LookupXLOOKUP(search_key, lookup_range, result_range, missing_value, [match_mode], [search_mode])

The XLOOKUP function in Google Sheets returns the values in the result range based on the position where a match was found in the lookup range. If no match is found, it returns the closest match. With its versatile capabilities, the XLOOKUP function is a valuable, modern replacement for VLOOKUP and INDEX/MATCH. Dive into our comprehensive guide to master its application.

Parameters

  • search_key: The value or cell reference to search for.
  • lookup_range: The range of cells to search for the search_key.
  • result_range: The range of cells from which to retrieve the results.
  • missing_value: The value to return if no match is found.
  • [match_mode]: [Optional] The match mode to use. Default is 0 (exact match).
  • [search_mode]: [Optional] The search mode to use. Default is 1 (search first to last).

Video Example

Step-by-Step Tutorial

  1. Using XLOOKUP for an exact match:
    • Example: If A1:A5 contains product names and B1:B5 contains their prices, =XLOOKUP("Widget", A1:A5, B1:B5, "Not found") returns the price for "Widget".
    • Result: The matching price, or "Not found" if "Widget" isn't in A1:A5.

Use Cases and Scenarios

  1. Data Lookup: Retrieve specific data based on a search key, similar to VLOOKUP but without column-index counting.
  2. Index-Match Replacement: Replace complex INDEX/MATCH formulas with a single, simpler function.
  3. Approximate Matching: Find the closest match to the search key using match_mode.
  4. Dynamic Data Extraction: Extract relevant information from a range based on changing criteria.

Related Functions

  • VLOOKUP: Vertical lookup that searches down the first column of a range for a key.
  • INDEX: Returns the content of a cell, specified by row and column offset.
  • MATCH: Returns the relative position of an item in a range that matches a specified value.

Related Articles

Newsletter

More XLOOKUP examples coming soon.

We are building short, practical updates for Sheets power users.