Excel XLOOKUP Formula Generator
Enter the value to find, where to look and what to return, and get a working XLOOKUP plus versions for older Excel.
Processed locally in your browser/ Your data stays in your browser.
What is Excel XLOOKUP Formula Generator?
XLOOKUP is the modern replacement for VLOOKUP: it searches one range and returns the item at the same position in another, it can look left, it has a built-in "if not found" argument and it does not break when columns are inserted. Its optional match and search modes are easy to get wrong, though, so this generator writes them for you.
Fill in the lookup value, the lookup range and the return range (a single column or several), then choose the not-found text, the match mode (exact, next smaller, next larger or wildcard) and the search mode (first to last, last to first or binary). The tool shows the formula, an explanation and, for workbooks that do not have XLOOKUP, a VLOOKUP version when it is possible and an INDEX and MATCH version, including the classic LOOKUP trick for the last match.
How does it work?
- Enter the lookup value, usually a cell such as A2, and the lookup range where that value is searched, such as Sheet2!A:A.
- Enter the return range that holds the answer (Sheet2!D:D, or D:F for several columns) and the text to show when nothing matches.
- Choose the match mode and search mode if you need more than an exact, first-to-last search.
- Copy the formula, or copy one of the equivalents if your Excel version lacks XLOOKUP. The separator and function language can be changed for regional versions.
Common use cases
- Pulling a price, a name or a status from another sheet by ID without counting columns.
- Looking up a value that sits to the left of the key column, which VLOOKUP cannot do.
- Finding the last order of a customer with the last-to-first search mode.
- Assigning tiers or tax bands with "exact or next smaller" on a sorted threshold table.
Examples
Enter the value to find, where to look and what to return, and get a working XLOOKUP plus versions for older Excel.
Privacy
Excel XLOOKUP Formula Generator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
XLOOKUP exists only in Excel 2021, Microsoft 365 and Excel for the web. The generator does not read your workbook, so it cannot check that the ranges hold what you expect, and the VLOOKUP equivalent is possible only for simple, same-sheet ranges.
Frequently asked questions
What is the difference between XLOOKUP and VLOOKUP?
VLOOKUP needs a table array and a column number and only searches the first column, so it cannot look left and breaks when a column is inserted. XLOOKUP takes the lookup range and the return range separately, defaults to an exact match and has a built-in not-found argument.
What do the match modes do?
0 is an exact match, -1 returns the exact item or else the next smaller one, 1 returns the exact item or else the next larger one, and 2 allows the wildcards * and ? in the lookup value. The last two are useful for tax bands or price tiers on a table sorted by threshold.
How do I get the last match instead of the first?
Set the search mode to "last to first" (-1). XLOOKUP then scans from the bottom, which returns the most recent row for a customer or product. The tool also shows the LOOKUP(2,1/(range=value),result) trick that does the same in older versions.
Related tools
Excel VLOOKUP Formula Generator
Fill in four fields and get a VLOOKUP with the right last argument, an optional IFERROR and warnings about the classic pitfalls.
Excel Tools
Excel Formula Explainer
Paste a formula you inherited or copied from the web and see what every function, reference and operator does, in nested order.
Excel Tools
Excel IF Formula Generator
Choose the cell, the test and the results, and get a ready-to-paste IF formula with an explanation and an IFS version when you add branches.
Excel Tools
Excel SUMIFS Formula Generator
Pick the range to add up, add up to four conditions and get a SUMIFS with correctly quoted criteria, ready to paste.
Excel Tools
Excel COUNTIFS Formula Generator
Describe up to four conditions and get a COUNTIFS that counts the rows matching all of them, with dates and wildcards written correctly.
Excel Tools
Excel Column Letter ↔ Number Converter
Paste column letters or column numbers, one per line, and get the matching number or letters instantly, with a note for every line.
Excel Tools