One column
XLOOKUP(lookup_value, lookup_array, return_array)
return_array is a single column. The result is one value. Call it again with a second return column when you need another field from the same row.
In Excel 2021, Excel 2024, Microsoft 365, and Google Sheets, XLOOKUP spills every column of its return range, so one formula can bring back a price and a quantity. Excel 2019 does not have XLOOKUP. A pair of formulas, one return column each, works anywhere XLOOKUP works and is what you should type when a checker grades a single cell. INDEX/MATCH can do the same pair.
XLOOKUP(lookup_value, lookup_array, return_array)
return_array is a single column. The result is one value. Call it again with a second return column when you need another field from the same row.
XLOOKUP(lookup_value, lookup_array, first_column:last_column)
When the return range is wider than one column, Excel and Google Sheets spill the whole row of results to the right of the formula. Neighboring cells must be empty or you get a #SPILL! error in Excel.
INDEX(return_column, MATCH(lookup_value, lookup_column, 0))
Repeat INDEX with a different return column and the same MATCH. This is the version for Excel without XLOOKUP, and it never depends on a spill.
| Question | Two XLOOKUPs | One spilling XLOOKUP | INDEX/MATCH |
|---|---|---|---|
| What you type | One formula per field | One formula, a wide return range | One INDEX per field, MATCH shared or repeated |
| Excel 2019 and earlier | No XLOOKUP | No XLOOKUP | Works |
| Excel 2021, Microsoft 365, Google Sheets | Works | Spills the extra columns | Works |
| Formula Drills checker | Each formula returns its own value | A two-column return evaluates to #VALUE! in this engine | Each INDEX returns its own value |
| Empty cells to the right | Not required | Required in Excel or the spill is blocked | Not required |
E2 is Book. The price is in column B and the quantity is in column C. Two XLOOKUP formulas, or two INDEX/MATCH formulas, each return one of those fields.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Product | Price | Qty | Find | |
| 2 | Pen | 1.5 | 4 | Book | |
| 3 | Book | 12 | 2 | ||
| 4 | Lamp | 24 | 1 |
=XLOOKUP(E2,A2:A4,B2:B4) → 12=XLOOKUP(E2,A2:A4,C2:C4) → 2=INDEX(B2:B4,MATCH(E2,A2:A4,0)) → 12=INDEX(C2:C4,MATCH(E2,A2:A4,0)) → 2Both lookups search A2:A4 for Book. The first returns B, the price 12. The second returns C, the quantity 2. The MATCH position is 2 in both INDEX formulas, which is why a model sometimes calculates MATCH once in a helper cell and points both INDEX formulas at it.
The Excel formula for both fields at once is a return range from the price through the quantity. Here is that formula evaluated by the same engine the drills use.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Product | Price | Qty | Find | |
| 2 | Pen | 1.5 | 4 | Book | |
| 3 | Book | 12 | 2 | ||
| 4 | Lamp | 24 | 1 |
=XLOOKUP(E2,A2:A4,B2:C4) → #VALUE!Excel 2021, Excel 2024, Microsoft 365, and Google Sheets spill 12 and 2 across two cells from this formula, as long as the cell to the right is empty. Formula Drills' engine does not spill that return range. It returns #VALUE!. That is why the graded drills ask for one return column. Type the two formulas from the previous example when you are practicing here, and use the wide return range only in a desktop or Google sheet that spills.
A price cell and a quantity cell should each contain a formula that fills that one cell. The sheet stays obvious, and it still works if a note gets typed beside the price. This is also the shape the premium XLOOKUP drill grades.
A quote line that should appear as price, quantity, and extended amount can start with one XLOOKUP whose return range covers those columns. Leave the spill area empty. If you might open the file in Excel 2019, do not depend on the spill.
Repeat INDEX for each column you need and keep the MATCH identical. You get the same two numbers, 12 and 2, without a function the older workbook cannot run.
The engine result for XLOOKUP with return range B2:C4 is #VALUE!, not 12 in one cell and 2 in the next. Split the return ranges.
If the cell to the right of a spilling XLOOKUP already holds a label or a note, Excel shows #SPILL! and returns nothing. Clear that cell or switch to one formula per column.
A second XLOOKUP that still points at B2:B4 will show the price again where you wanted the quantity. Read the return range after you copy.
B2:B4 and C1:C3 are not the same rows. The quantity would come from the wrong line. Keep the return range aligned with the lookup range.
XLOOKUP itself requires Excel 2021, Excel 2024, Microsoft 365, Excel for the web, or Google Sheets. A multi-column spill is a dynamic-array behavior of those same Excel versions and of Google Sheets. Excel 2019 has neither XLOOKUP nor that spill.
INDEX and MATCH, one column at a time, work in older Excel and in Google Sheets.
The #VALUE! shown for the wide return range is the result in Formula Drills' formula engine. Do not read it as the result Excel shows for the same formula.
Free drills are open with no account. Premium drills show the problem to everyone and grade the sheet for subscribers.
In Excel 2021 and later, and in Google Sheets, yes, if the return range covers that row's fields and the spill area is empty. In this site's checker, split the return into one column per formula.
Use a separate XLOOKUP or INDEX for each column. A single rectangular return range can only cover a block of neighboring columns.
One VLOOKUP returns one column index. You write a second VLOOKUP with a different index, or you switch to XLOOKUP or INDEX/MATCH. There is a drill for the single-column case.
Add the if_not_found argument to each XLOOKUP, or wrap each lookup in IFNA. A spill does not remove the need to decide what a miss should show.