Flexible table lookups
Return data from any direction without depending on a fixed column index.
Spreadsheet utility
This page is for modern lookup workflows where readability and maintainability matter more than legacy compatibility.
Use XLOOKUP when you want a cleaner lookup formula, explicit return ranges, and easier maintenance than classic VLOOKUP.
Overview
XLOOKUP removes several limitations that made VLOOKUP awkward in growing spreadsheets. You no longer need to count return columns manually, and you can search left or right without restructuring the table.
This page is designed for people who want the cleaner modern lookup pattern from the start, especially in newer workbooks where maintainability matters more than legacy familiarity.
How to use it
Step 1
Describe the lookup value, the range to search, and the range to return.
Step 2
Choose your platform and generate the formula.
Step 3
Copy the result, then adjust ranges or the not-found value to match your sheet.
Use cases
Return data from any direction without depending on a fixed column index.
Keep formulas easier to read when tables change or grow over time.
Use a custom not-found result instead of showing a raw error when nothing matches.
Practical examples
These examples focus on the reasons people prefer XLOOKUP in new workbooks: explicit return ranges, clearer logic, and cleaner handling of missing matches.
Prompt: Return product name from B:B based on code in A2 matched in A:A
Example formula
=XLOOKUP(A2,A:A,B:B,"Not found")Searches A:A for the code in A2 and returns the product name from B:B, or Not found if there is no match.
Prompt: Find customer tier from D:D using customer ID in G2 matched in C:C
Example formula
=XLOOKUP(G2,C:C,D:D,"Not found")Matches the customer ID in G2 against C:C and returns the corresponding tier from D:D.
Prompt: Return not found if the product code does not exist
Example formula
=XLOOKUP(A2,A:A,B:B,"Not found")Uses the fourth argument to show a custom message when the lookup value is missing.
Prompt: Match order ID from one list and return value from another column
Example formula
=XLOOKUP(A2,Orders!A:A,Orders!D:D,"Not found")Finds the order ID in the source list and returns a value from another column in the same row.
Why people prefer it
The main reason XLOOKUP is easier to maintain is that the return range is explicit. You do not have to count columns or worry that inserting a new column in the middle of a table will break the logic silently.
That makes it a strong fit for files that evolve over time, especially when more than one person edits the workbook.
A practical note
XLOOKUP is often the better modern choice because the formula says more clearly what it is doing. That matters when someone else has to review, debug, or extend the workbook later.
VLOOKUP literacy still matters because older spreadsheets continue to use it, but new work is usually easier to maintain when you start with XLOOKUP instead.
FAQ
It searches one range and returns the corresponding value from another range, which makes it ideal for modern lookup workflows.
Use XLOOKUP when you want explicit return ranges, easier maintenance, custom not-found output, or lookups that may need to search in either direction.
In many cases, yes. It is usually more flexible, easier to read, and less fragile when table layouts change.
Google Sheets supports XLOOKUP, although usage can vary by workflow and some teams still rely on older patterns.
Yes. It can generate XLOOKUP formulas that return a custom result instead of a raw error when nothing matches.
Yes. It is still common in older files, even though XLOOKUP is often easier for new workflows.
Next pages
Use XLOOKUP for cleaner new work. Switch to VLOOKUP when compatibility with older workbooks or existing formulas is the real constraint.
Generate classic first-column lookup formulas for existing workbooks and shared sheets.
Start from a plain-English task and get a full Excel formula you can adapt.
Browse copy-ready reference formulas before generating something more custom.
Understand what an existing formula does before you edit or replace it.