make "lookup array" and "return array" based on table headings

smking204

New Member
Joined
Jan 28, 2021
Messages
41
Office Version
  1. 365
Platform
  1. Windows
here's the formula I'm working with:

=XLOOKUP(A13,BC_Items!$A:$A,BC_Items_31!$B:$B,"")

I want the "lookup array" and "return array" to follow the headings, since the column addresses are subject to change.

I used to accomplish this by using vlookup and using MATCH() to determine the column index. Hoping I can migrate this functionality over to xlookup somehow.

Thanks so much!!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
There is nothing wrong with using VLOOKUP. I read an article that MS optimized a bunch of functions to improve speed including VLOOKUP.

If you insert or delete columns in the BC_Items table, your XLOOKUP formula will adjust automatically.

It's puzzling how you are using columns from 2 different tables in the XLOOKUP function. Is that data identical?

What are your column headers?

You can use the combination of Index / Match to get a column with a header match, like below

Book4
ABCDE
1Header1Header2Header3Header2
211
322
433
50
60
Sheet1
Cell Formulas
RangeFormula
E:EE1=INDEX(A:C,,MATCH("Header2",A1:C1,0))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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