Return a Whole Row with XLOOKUP

Excel Formulas › Dynamic Arrays

365 / 2021XLOOKUP

One lookup, many columns. Point XLOOKUP’s return argument at several columns and it spills the matching row’s whole record — no repeated lookups, no column-index counting.


Quick formula: return the name, region, and sales for an ID:
=XLOOKUP(A2, IDs, data[Name]:data[Sales])
When the return range spans multiple columns, XLOOKUP spills all of them for the matched row in one formula.

Functions used (tap for the full reference guide):

The example

One ID lookup returns the full record.

ABC
1NameRegionSales
2AnnEast95

The formula

Return several columns at once:

=XLOOKUP(A2, IDrange, C2:E100) // spills the whole matching row

How it works

A multi-column return range spills the record:

  1. Use XLOOKUP as usual — lookup value, lookup array — but make the return array several columns wide.
  2. XLOOKUP returns the matched row across all those columns, spilling into the neighbors.
  3. To reorder or pick specific fields, wrap with CHOOSECOLS: CHOOSECOLS(XLOOKUP(…), 3, 1).
  4. This replaces three separate VLOOKUPs (or INDEX/MATCH calls) with one clean formula.

Horizontal or vertical. If your return range is a single wide row, XLOOKUP spills horizontally; a tall block spills vertically. Combine with HSTACK to assemble a custom record from non-adjacent columns.

Try it: interactive demo

Live demo

Look up an ID; return the whole row.

Record:

Variations

Reorder fields

Pick columns:

=CHOOSECOLS(XLOOKUP(A2, ids, data), 3, 1)

Two-way lookup

Row and column match:

=XLOOKUP(rowKey, rows, XLOOKUP(colKey, cols, grid))

If not found

Default record:

=XLOOKUP(A2, ids, data, "not found")

Pitfalls & errors

Spill space. A multi-column return needs empty neighbor cells, or #SPILL!.

365/2021 for XLOOKUP. Older Excel uses INDEX/MATCH; a multi-column INDEX return also spills in 365.

Return range orientation. Match the return block’s shape to how you want it to spill (row vs column).

Practice workbook

📊
Download the free Return a Whole Row with XLOOKUP practice workbook
XLOOKUP multi-column return (formula text + result) with reorder, two-way, and default variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I return multiple columns with XLOOKUP?
Make the return array several columns wide: =XLOOKUP(key, ids, C2:E100) spills the whole matching row in one formula. Requires Excel 365/2021.
How do I reorder the returned fields?
Wrap with CHOOSECOLS: =CHOOSECOLS(XLOOKUP(key, ids, data), 3, 1) returns the columns in your chosen order.
Why do I get a #SPILL! error?
A multi-column return needs empty cells to spill into. Clear the neighboring cells.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Lookup return multiple · CHOOSEROWS & CHOOSECOLS · Lookup multiple criteria

Function references: XLOOKUP · CHOOSECOLS