How do I use XLOOKUP in Excel?
Enter the lookup value, lookup range, and return range in order. For example, to return stock from a product ID, use XLOOKUP(B2, B2:B8, D2:D8, "N/A").
Modern lookup function with flexible matching.
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found])lookup_value
RequiredEnter the value you want to look up.
lookup_array
RequiredSpecify the row/column range where the lookup key is searched.
return_array
RequiredSpecify the range to return when a match is found.
if_not_found
OptionalSpecify the value returned when no match is found.
Use XLOOKUP to return the result with these settings (Lookup value: B2 (cell B2 (Product Name in column B)), Lookup array: B2:B8 (Product Name in column B), Return array: D2:D8 (Stock in column D), If not found: "N/A"). You can set ranges by dragging from the start cell to the end cell in the same argument field.
| # | AProduct ID | BProduct Name | CPrice | DStock |
|---|---|---|---|---|
| 2 | P001 | Apple | 120 | 80 |
| 3 | P002 | Banana | 98 | 120 |
| 4 | P003 | Notebook | 450 | 35 |
| 5 | P004 | Pen | 300 | 60 |
| 6 | P005 | Grapes | 150 | 45 |
| 7 | P006 | Ruler | 250 | 20 |
| 8 | P007 | Peach | 86 | 55 |
How to Use (Formula)
=XLOOKUP(B2, B2:B8, D2:D8, "N/A")Result
80
Enter the lookup value, lookup range, and return range in order. For example, to return stock from a product ID, use XLOOKUP(B2, B2:B8, D2:D8, "N/A").
Use the "Start Function Practice" button to jump straight into XLOOKUP drills.
The main arguments are Lookup value, Lookup array, Return array, If not found. Start with the required ones, then add optional arguments if needed.