ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. XLOOKUP to Return Multiple Columns at Once

XLOOKUP to Return Multiple Columns at Once

By ExcelReady Team·Updated November 2, 2026·5 min read

The short answer

Give XLOOKUP a return array that is several columns wide. =XLOOKUP(G2,A2:A6,C2:E6) finds the ID in G2 and returns the matching values from columns C, D and E at once. They spill into the cells to the right, so keep those cells empty. XLOOKUP needs Excel 2021, Excel 2024 or Microsoft 365.

Key takeaways

  • A return array several columns wide makes XLOOKUP return the whole matching row section: =XLOOKUP(G2,A2:A6,C2:E6).
  • The results spill to the right. Any value already in the way causes #SPILL!.
  • Wrap the result in SUM, MAX or TEXTJOIN to turn the returned columns into one answer.
  • For columns that are not next to each other, use HSTACK or CHOOSECOLS (Microsoft 365 or Excel 2024).
  • To return several rows of results, write the formula once with $ signs and fill it down.
On this page+
  1. How to return multiple columns with one XLOOKUP
  2. How to fix #SPILL! when returning several columns
  3. How to return columns that are not next to each other
  4. How to look up a column by its header
  5. How to sum or join the returned columns
  6. How to fill the formula down for several IDs
  7. XLOOKUP vs VLOOKUP for multiple columns
  8. Practise it

To make XLOOKUP return multiple columns, select several columns as the third argument, the return array. =XLOOKUP(G2,A2:A6,C2:E6) finds an ID and brings back three values at once, which spill into the cells to the right. This guide shows that basic pattern, then how to pick columns out of order, total them, and fill the formula down for a list of IDs.

All the examples use this quarterly sales table in A1:E6:

ABCDE
1IDNameQ1Q2Q3
2R101Ana120001500014000
3R102Omar90001100013000
4R103Lena160001200015000
5R104Raj100001000012000
6R105Zoe140001700016000

XLOOKUP needs Excel 2021, Excel 2024 or Microsoft 365. If you are new to it, start with the XLOOKUP guide.

How to return multiple columns with one XLOOKUP#

XLOOKUP has three required parts: what to find, where to look, and what to return. The return array can be one column or several. With R103 in G2, type this in H2:

Excel formula
=XLOOKUP(G2,A2:A6,C2:E6)

Excel finds R103 in row 4 of the table and returns that row's values from C, D and E: 16000 in H2, 12000 in I2 and 15000 in J2. You typed one formula, but three cells fill. This is called spilling. Click I2 and the formula bar shows the formula greyed out, because it lives only in H2.

To return the name as well, widen the return array to B2:E6. The result then spills across four cells: Lena, 16000, 12000, 15000. The only rule is that the return array has the same number of rows as the lookup array. The XLOOKUP function guide lists every argument.

How to fix #SPILL! when returning several columns#

A #SPILL! error means the results have nowhere to go. XLOOKUP needs every cell in its spill range to be empty. If J2 holds a note, the H2 formula shows #SPILL! and returns nothing. Fix it by:

  • Clearing the blocking cell. Click the error and Excel outlines the spill range with a dashed border so you can see which cells it needs.
  • Moving the formula somewhere with enough empty cells to its right.
  • Moving it out of an Excel table. Spilled formulas can't sit inside a table.

How to return columns that are not next to each other#

Sometimes you want the name and Q3 only, skipping Q1 and Q2. In Microsoft 365 or Excel 2024, stack the columns you want into one return array with HSTACK:

Excel formula
=XLOOKUP(G2,A2:A6,HSTACK(B2:B6,E2:E6))

This returns Lena and 15000, side by side. You can list the columns in any order: HSTACK(E2:E6,B2:B6) puts Q3 first. Another option is CHOOSECOLS, which picks columns by number from the full result: =CHOOSECOLS(XLOOKUP(G2,A2:A6,B2:E6),1,4) gives the same two values.

In Excel 2021, which has neither function, write one XLOOKUP per column instead. It is more typing, but it works.

How to look up a column by its header#

If you want one value but the column changes, look up the header too. Put an XLOOKUP inside the return array:

Excel formula
=XLOOKUP(G2,A2:A6,XLOOKUP("Q2",C1:E1,C2:E6))

The inner XLOOKUP finds "Q2" in the headers and returns that whole column, D2:D6. The outer one then finds R103 in it: 12000. Replace "Q2" with a cell, such as H1, and copy the formula across under headers Q1, Q2 and Q3 to rebuild the row. Lock the ranges first: =XLOOKUP($G2,$A$2:$A$6,XLOOKUP(H$1,$C$1:$E$1,$C$2:$E$6)).

How to sum or join the returned columns#

Wrap the result in another function to turn several values into one answer. Nothing spills, because the outer function returns a single value:

GoalFormulaResult for R103
Total sales for Q1 to Q3=SUM(XLOOKUP(G2,A2:A6,C2:E6))43000
Best quarter=MAX(XLOOKUP(G2,A2:A6,C2:E6))16000
All values in one cell=TEXTJOIN(", ",TRUE,XLOOKUP(G2,A2:A6,B2:E6))Lena, 16000, 12000, 15000

The guide to returning multiple values from a lookup covers the opposite case: many matching rows rather than many columns.

How to fill the formula down for several IDs#

To return several columns for a list of IDs, write the formula once and fill it down. Say G2:G4 hold R101, R103 and R105. In H2, lock the table ranges with $ (press F4 on Windows, or Cmd+T on a Mac, while the cursor is on the range):

Excel formula
=XLOOKUP(G2,$A$2:$A$6,$C$2:$E$6)

Fill down to H4 (Windows: Ctrl+D; Mac: Cmd+D). Each row spills its own three values. G2 has no $, so it changes to G3 and G4 as you fill, while the table stays fixed.

If an ID might be missing, add a fourth argument: =XLOOKUP(G2,$A$2:$A$6,$C$2:$E$6,"Not found"). When there is no match, you get one "Not found" instead of three columns. When the match needs two conditions, such as region and product, see XLOOKUP with multiple criteria.

XLOOKUP vs VLOOKUP for multiple columns#

VLOOKUP can only return one column per formula, because its column number is a single value. To get three columns you need three formulas, each with a different column number, or an array trick that only works in newer Excel. XLOOKUP does it with one range. XLOOKUP also keeps working when someone inserts a column into the table, because it uses ranges instead of a column number. A VLOOKUP with a hard-coded 3 quietly starts returning the wrong column. If your files must open in Excel 2019 or earlier, the guide to returning several columns with VLOOKUP shows the older methods.

Practise it#

Practise XLOOKUP in a live spreadsheet: you type each lookup and it checks your answer instantly. Then try the exercise on this page, and move on to the modern Excel functions lesson to practise spilling formulas like FILTER, UNIQUE and SORT.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

R103 is already in G2. In H2, write one XLOOKUP that returns Lena's Q1, Q2 and Q3 sales (C2:E6) at once.

fx
ABCDEFGHI
1
ID
Name
Q1
Q2
Q3
ID
2
R101
Ana
12000
15000
14000
R103
3
R102
Omar
9000
11000
13000
4
R103
Lena
16000
12000
15000
5
R104
Raj
10000
10000
12000
6
R105
Zoe
14000
17000
16000
7
8
9

Tip: Look up G2 in the ID column A2:A6, and select all three quarter columns, C2:E6, as the return array.

Practise this in a lesson

LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.LessonModern Excel: XMATCH, SORTBY, TEXTSPLIT and spill references (A2#)Split names with TEXTSPLIT, find positions with XMATCH, sort by another column with SORTBY, and refer to a whole spilled result with A2#.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.

Frequently asked questions

Can XLOOKUP return multiple columns?

+

Yes. Select more than one column as the return array, such as C2:E6, and XLOOKUP returns the matching value from each column. The results spill into the cells to the right.

Why does XLOOKUP return #SPILL!?

+

The cells the results need to spill into are not empty. Clear them, or move the formula to a spot with enough empty cells to its right. Spilled results also can't go inside an Excel table.

How do I return non-adjacent columns with XLOOKUP?

+

In Microsoft 365 or Excel 2024, build the return array with HSTACK, for example =XLOOKUP(G2,A2:A6,HSTACK(B2:B6,E2:E6)). In Excel 2021, write one XLOOKUP per column instead.

Can I sum the multiple columns XLOOKUP returns?

+

Yes. Wrap the formula in SUM: =SUM(XLOOKUP(G2,A2:A6,C2:E6)) adds the three returned values and gives one number, so nothing spills.

Does XLOOKUP returning multiple columns work in Excel 2016 or 2019?

+

No. XLOOKUP is not available in those versions. Use VLOOKUP with a different column number in each cell, or INDEX and MATCH.

Sources

  • XLOOKUP function - Microsoft Support
  • Dynamic array formulas and spilled array behavior - Microsoft Support
  • How to correct a #SPILL! error - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How to return multiple columns with one XLOOKUP
  2. How to fix #SPILL! when returning several columns
  3. How to return columns that are not next to each other
  4. How to look up a column by its header
  5. How to sum or join the returned columns
  6. How to fill the formula down for several IDs
  7. XLOOKUP vs VLOOKUP for multiple columns
  8. Practise it

Keep reading

Lookups· 6 min read

VLOOKUP to Return Several Columns at Once

To make VLOOKUP return multiple columns, lock the lookup cell and table with $ signs and let COLUMN supply the column number as you copy right: =VLOOKUP($F2,$A$2:$D$6,COLUMN(B1),FALSE). In Microsoft 365, =VLOOKUP(F2,A2:D6,{2,3,4},FALSE) spills all three columns at once. XLOOKUP can return several columns by selecting them as the return range.

Lookups· 6 min read

XLOOKUP With Multiple Criteria

XLOOKUP has no separate argument for a second condition, so you combine the criteria yourself. Either join them: =XLOOKUP(G2&"|"&H2,A2:A8&"|"&B2:B8,C2:C8), or multiply tests and look up 1: =XLOOKUP(1,(A2:A8=G2)*(B2:B8=H2),C2:C8). Both return the first row where every condition is true. XLOOKUP needs Excel 2021 or Microsoft 365.

Lookups· 6 min read

Return Every Match for a Lookup in Excel (FILTER)

VLOOKUP and XLOOKUP stop at the first match. To return every match, use FILTER: =FILTER(B2:B7,A2:A7=F2) lists all the orders for the customer in F2, spilling one per row. Add a third argument such as "No orders" for when nothing matches, and wrap it in TEXTJOIN to put all matches in one cell. FILTER needs Excel 2021 or Microsoft 365.

More on lookups

  • XLOOKUP Wildcards and Match Modes Explained
  • XMATCH Function in Excel: Find a Position
  • Check If a Value Exists in a List in Excel
  • Find the Closest Match in Excel
  • How to Compare Two Lists in Excel
  • Find the First Non-Blank Cell in a Row or Column in Excel
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free