XLOOKUP vs VLOOKUP: what changed and which to use
XLOOKUP vs VLOOKUP side by side: exact match by default, looking left, no column numbers, built-in not-found text. With formulas and when VLOOKUP still makes sense.
Find the name for each staff ID in E2:E6. The IDs are in column C, to the right of the names.
keyboard Typing formulas is easiest on a computer with a keyboard.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Name | Department | Staff ID | Staff ID | Name | ||
| 2 | Mateo Walsh | Sales | S1530 | S1300 | |||
| 3 | Isla Garcia | Sales | S1880 | S1250 | |||
| 4 | Zoe Okafor | IT | S1400 | S1690 | |||
| 5 | Amara Silva | HR | S1640 | S1070 | |||
| 6 | Priya Brennan | Finance | S1690 | S1530 | |||
| 7 | Victor Fischer | Operations | S1250 | ||||
| 8 | Uma Silva | Finance | S1890 | ||||
| 9 | Nadia Patel | Operations | S1090 | ||||
| 10 | Hiro Patel | Operations | S1300 | ||||
| 11 | Rosa Evans | HR | S1070 | ||||
| 12 | |||||||
| 13 | |||||||
| 14 | |||||||
| 15 |
VLOOKUP look left?VLOOKUP always searches the first column of its table and can only return columns to the right of it. When the column you search is on the right, such as an ID in column C and names in column A, VLOOKUP can't reach the names.
INDEX and MATCH fix it?Split the lookup into two steps:
MATCH finds the position of the ID in its column.INDEX takes the value at that position from any other column.=INDEX($A$2:$A$11,
Both ranges must start on the same row and be the same size, so that position 3 in one is the same row as position 3 in the other. Start both at row 2, under the headers.
XLOOKUP exists?XLOOKUP does the same in one function, but it is only in Excel 2021 and newer. INDEX and MATCH work in every version of Excel and in Google Sheets, so you will meet them in older workbooks all the time.
XLOOKUP vs VLOOKUP side by side: exact match by default, looking left, no column numbers, built-in not-found text. With formulas and when VLOOKUP still makes sense.
Know someone fighting with a spreadsheet? Send them this page.