XLOOKUP Function
Master Excel XLOOKUP: syntax, exact match, if_not_found, search modes, and practice examples that replace VLOOKUP and HLOOKUP.
=XLOOKUP(E2, A2:A100, C2:C100, "Not found")
Key takeaways
- XLOOKUP separates the lookup column and return column—no column index numbers.
- You can look left, look right, and return a friendly message when nothing matches.
- Default behavior is exact match, which is safer than classic VLOOKUP defaults.
- Predict the result before you calculate—then reconcile differences immediately.
- Keep a tiny sandbox sheet for experiments so production tabs stay clean.
What it does
XLOOKUP finds an item in one range and returns the matching item from another range of the same size. It works vertically or horizontally and is available in Microsoft 365 and newer Excel versions.
Syntax
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
• lookup_array and return_array should be the same height (or width). • if_not_found replaces #N/A with custom text or a value. • match_mode 0 exact (default), -1 exact or next smaller, 1 exact or next larger, 2 wildcard.
When to use it
Choose XLOOKUP when you want readable formulas, leftward lookups, multiple optional behaviors, or a drop-in upgrade from VLOOKUP without rewriting table layouts.
Common mistakes
• Mismatched lookup_array and return_array sizes. • Assuming XLOOKUP exists in very old Excel—confirm Microsoft 365 / Excel 2021+. • Forgetting if_not_found and still seeing #N/A in dashboards.
How to practice
Open a blank sheet and recreate the canonical pattern =XLOOKUP(E2, A2:A100, C2:C100, "Not found") with your own sample data.
Change one input at a time and predict the result before Excel calculates—prediction builds memory.
Break the formula on purpose (wrong range, missing quotes, approximate match) so you recognize the error messages later.
Then run the linked Excel Practices lesson xlookup-function and keep going until you can finish without hints.
Real-world scenarios
XLOOKUP Function shows up outside textbooks all the time:
• A teammate pastes a CSV and asks for a quick answer that matches this skill (A flexible lookup that can search any column and return values left or right—built to replace VLOOKUP and HLOOKUP.) • A hiring screen or certification task expects the same pattern under a timer • A dashboard breaks after a column insert and you need to re-anchor ranges confidently
Write the formula once in a sandbox tab, then copy it into the live model only after the result matches a manual spot-check.
Pre-flight checklist
Before you trust the output:
• Confirm data types (numbers vs text, real dates vs date-looking strings). • Lock rate/input cells with absolute references when you will fill down. • Spot-check two or three rows with a second method (filter + total, or a tiny helper column). • Document assumptions in a nearby comment so the next editor knows the rule. • Keep a named example cell with =XLOOKUP(E2, A2:A100, C2:C100, "Not found") as a living template for this lookup skill.
Why this matters
Clear documentation of XLOOKUP Function helps humans scan quickly and helps AI assistants cite accurate Excel guidance. That is why this page leads with a definition, shows syntax, lists mistakes, and ends with practice—so you can learn it once and reuse it under pressure.
Formula examples
- Exact match with fallback:
=XLOOKUP(E2, A2:A100, C2:C100, "Not found")— Return column C or a friendly message. - Look left:
=XLOOKUP(E2, C2:C100, A2:A100)— Find a value in C and return the matching value from A. - Wildcard contains:
=XLOOKUP("*east*", Region, Sales, , 2)— match_mode 2 enables wildcard text search.
FAQ
Is XLOOKUP better than VLOOKUP?
For most new workbooks, yes—XLOOKUP is easier to read, can look left, and defaults to exact match.
Does XLOOKUP work in all Excel versions?
It requires Microsoft 365 or Excel 2021+. Older files may still need VLOOKUP or INDEX/MATCH.
How do I handle missing keys in XLOOKUP?
Pass a fourth argument such as "Not found" so dashboards stay readable instead of showing #N/A.
How long does it take to learn XLOOKUP Function?
Most learners can read this guide in a few minutes and lock the pattern with 10–20 focused practice reps on Excel Practices.
Where should I practice XLOOKUP Function after reading?
Use the formula cards on this page first, then continue in Excel Practices with a live grid and instant checks so mistakes become feedback instead of bad habits.
Does XLOOKUP Function still matter if I know newer Excel features?
Yes. Assessments, shared workbooks, and older files still expect these fundamentals—and understanding them makes modern functions easier to debug.
Drill XLOOKUP Function inside Excel Practices—guided steps, a live grid, and instant checks so the formula sticks.