# XLOOKUP formula generator

> Describe what you need and get a XLOOKUP formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested XLOOKUP examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/xlookup · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

XLOOKUP searches one column or row for a value and returns the matching item from another.

Describe the task at [XLOOKUP formula generator](https://spreadsheetpractice.com/tools/formula-generator/xlookup) and get a XLOOKUP formula for Excel and Google Sheets, tested on real data.

## Tested XLOOKUP examples

### Look up a value to the left

`=XLOOKUP(G1,D2:D7,A2:A7)`

Excel. Result on the sample sheet: E-2203. [See it and try it](https://spreadsheetpractice.com/formulas/lookup-value-to-the-left)

### Look up a value between two numbers

`=XLOOKUP(E1,A2:A6,B2:B6,,-1)`

Excel. Result on the sample sheet: 6%. [See it and try it](https://spreadsheetpractice.com/formulas/lookup-value-between-two-numbers)

### Find the last occurrence of a value

`=XLOOKUP(F1,B2:B8,A2:A8,,0,-1)`

Excel. Result on the sample sheet: 6/6/2026. [See it and try it](https://spreadsheetpractice.com/formulas/find-last-match)

### Replace a long nested IF with a lookup table

`=XLOOKUP(B2,$E$2:$E$6,$F$2:$F$6,"Standard")`

Excel. Result on the sample sheet: 8 rows (C2:C9). [See it and try it](https://spreadsheetpractice.com/formulas/replace-nested-if-with-lookup-table)

### Why doesn't VLOOKUP find rows added to the bottom of the table

`=XLOOKUP(G1,A:A,C:C)`

Excel. Result on the sample sheet: $45.00. [See it and try it](https://spreadsheetpractice.com/formulas/vlookup-does-not-find-new-rows)

### Calculate commission with tiered percentage rates

`=B2*XLOOKUP(B2,$E$2:$E$5,$F$2:$F$5,,-1)`

Excel. Result on the sample sheet: 5 rows (C2:C6). [See it and try it](https://spreadsheetpractice.com/formulas/tiered-commission)

### Return the amount of the most recent order for a customer

`=XLOOKUP(1,(A2:A9=F1)*(B2:B9=MAXIFS(B2:B9,A2:A9,F1)),C2:C9)`

Excel. Result on the sample sheet: $1,460. [See it and try it](https://spreadsheetpractice.com/formulas/value-from-the-most-recent-date)

### Fix the #VALUE! error in XLOOKUP

`=XLOOKUP(G1,A2:A9,C2:C9)`

Excel. Result on the sample sheet: $129.00. [See it and try it](https://spreadsheetpractice.com/formulas/xlookup-value-error)

## Questions

### What does the XLOOKUP formula generator do?

You describe the task in plain English, and it writes the formula, using XLOOKUP where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does XLOOKUP do?

XLOOKUP searches one column or row for a value and returns the matching item from another.

### Can I learn to write XLOOKUP formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the XLOOKUP function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
