XLookup Variable Return Array Needed Similar to Vlookup & Match or Index & Match

eicherbiker

New Member
Joined
Aug 23, 2013
Messages
4
Hi, I would like to use the XLookup function; however, I keep stumbling on the Return Array and how it is frozen to a column. Is there a way to have the Return Array determined by referring to another cell and looking for its contents in column headers?

This is how I handle it now:
1692818442530.png


I'd like to use the XLookup, it's easier with the concatenate, but this is as close as I can get. I can't figure out how to do something like the Match function:

1692818538550.png
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Two options:
Excel Formula:
=XLOOKUP($J$2&$K$2,$B:$B&$C:$C,INDEX($D:$H,0,MATCH(L$1,$D$1:$H$1,0)),0,0)
=XLOOKUP($J$2&$K$2,$B:$B&$C:$C,CHOOSECOLS($D:$H,MATCH(L$1,$D$1:$H$1,0)),0,0)
 
Upvote 1
Solution
THANK YOU! I tried the ChooseCols function and it worked perfectly! This will be my new favorite nested function combination!
 
Upvote 0
Yet another option would be
Excel Formula:
=XLOOKUP(J2&K2,B2:B5&C2:C5,FILTER(D2:H5,D1:H1=L1))

(I would recommend not using whole column references. I can see my worksheet pause when concatenating the entire columns)

I also suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,215,143
Messages
6,123,274
Members
449,093
Latest member
Vincent Khandagale

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