Return the product name
Which product name belongs to the ID in E2?
Formula: =XLOOKUP(E2,A2:A5,B2:B5,"Not found") → Chair
Practice XLOOKUP in a live spreadsheet. Work through exact matches, missing values, two-way lookups, and lookup exercises with answers.
XLOOKUP becomes dependable when you stop thinking of it as a long formula and start seeing its parts: the value to find, the one-dimensional lookup range, and the equally sized return range. The live spreadsheet below uses a small catalog. Change the key, edit the formula, or deliberately request an ID that is not present to see how the result behaves.
The related XLOOKUP practice tasks build outward from that example. You will compare it with VLOOKUP, combine INDEX and MATCH, retrieve data from another sheet, and work through a mixed lookup set. Exact matching is the right default for IDs, codes, and names. Approximate matching is useful for ordered bands such as commission or grade thresholds, but it requires a different mental model and careful source data.
The worked answers focus on checks that catch quiet mistakes: matching array sizes, a stable key column, a deliberate not-found result, and test keys from different parts of the table. Those habits matter more than memorizing argument positions. For a broader hiring-focused sequence, follow the Excel interview preparation path after these tasks; it places lookups alongside cleanup, auditing, and business analysis questions.
Your turn: in F2, return the price for the product ID in E2.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Product ID | Product | Price | Find ID | ||
| 2 | P101 | Lamp | 18 | P103 | ||
| 3 | P102 | Desk | 45 | |||
| 4 | P103 | Chair | 24 | |||
| 5 | P104 | Shelf | 32 |
Answer: =XLOOKUP(E2,A2:A5,C2:C5,"Not found")
Open a task in its lesson.
Try the spreadsheet first, then compare your formula and result.
Which product name belongs to the ID in E2?
Formula: =XLOOKUP(E2,A2:A5,B2:B5,"Not found") → Chair
What price belongs to product ID P104?
Formula: =XLOOKUP("P104",A2:A5,C2:C5,"Not found") → 32
XLOOKUP separates the lookup and return arrays, can return values to the left, and provides an explicit not-found argument.
For IDs, names, and codes, exact match is usually the safe choice. Approximate modes are for ordered thresholds and require deliberate setup.
In modern Excel, the return array can span multiple columns and spill results. The linked tasks on this page practice single-column returns.
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page