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.
Why use it
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 message shown when no match is found.
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.
Show a clear message instead of 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 a clear message 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, fix, 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.
Missing matches
XLOOKUP makes the missing-match message a normal argument instead of something you have to bolt on later. That keeps the formula shorter and makes the intended output easier to review.
It still helps to confirm that the lookup range and return range cover the same rows. A friendly Not found message should explain a real missing key, not hide a mismatched range.
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, a clear result when no match is found, 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.
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.
Compare modern and legacy lookup formulas before choosing a pattern.