I want it all! Using single lookup command to return both multiple Rows and Columns

OlarFin

New Member
Joined
Aug 15, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have 3 worksheets:
  1. "Input Data". has 5k+ rows and 20 columns.
  2. "TeamInfo" has 20 rows and 5 columns.
  3. "Output" processes all rows from Input and merging the TeamInfo data.

I want to do a SINGLE lookup that returns multiple rows and columns from TeamInfo.

I found that both VLookup and XLookup behave the same in this instance ( but I like XLookup better)

I want to do the command below to get rows and columns, but all I get is the 1000 rows and a single column:
XLOOKUP($A10:$A1000,TeamInfo!$A$2:$A$21,TeamInfo!$B$2:$D$21)
So it's basically doing this:
XLOOKUP($A10:$A1000,TeamInfo!$A$2:$A$21,TeamInfo!$B$2:$B$21)

If I use the command below I get one row and 3 columns (which is expected from the command)
XLOOKUP($A10,TeamInfo!$A$2:$A$21,TeamInfo!$B$2:$D$21)

My source data can fluctuate as many as 1000 rows. I don't want to do a fill down. I know I can do it with VBA but I feel I'm so close.

Goal:
I want to load the data and have the columns and rows 🪄 Magically appear in my Output worksheet.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi & welcome to MrExcel.
How about
Excel Formula:
=DROP(REDUCE("",TOCOL(A10:A2000,1),LAMBDA(x,y,VSTACK(x,XLOOKUP(y,TeamInfo!$A$2:$A$21,TeamInfo!$B$2:$D$21,"")))),1)
 
Upvote 1
Solution
Hi & welcome to MrExcel.
How about
Excel Formula:
=DROP(REDUCE("",TOCOL(A10:A2000,1),LAMBDA(x,y,VSTACK(x,XLOOKUP(y,TeamInfo!$A$2:$A$21,TeamInfo!$B$2:$D$21,"")))),1)

Works like a charm! This really fit's Azimov's definition of magic!
I will be breaking this incantation to figure out exactly what it is doing.
Thanks!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,766
Messages
6,180,846
Members
453,001
Latest member
coulombevin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top