Dynamic header match

MikeWall

New Member
Joined
Sep 26, 2016
Messages
16
Office Version
  1. 2016
Hi Guys,

I have been trying to come up with a formula for an issue

In sheet one , i have a result sheet where i want return data set from sheet 2.

The criteria for choosing the results are 2 fold, based on lookupkeys, then criteria which is country).

However the issue is, in sheet two, the columns could change, such as Column Y could be new jersey today and tomorrow it could be mexico.

What formula could i use that returns the coulmn based of the matched criteria now matter where it was?


criteria
LookupkeysItalyIrelandEuropeJersey
Sam
dave
mike
Dataset
MexicoIrelandWashingtonUnited statesEurope
Sam
dave
mike
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
What Excel version are you using? Please 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.
 
Upvote 0
Account details updated now.
Thanks.

Is is something like this that you are after?

MikeWall 2020-04-02 1.xlsm
ABCDEF
1MexicoIrelandWashingtonUnited statesEurope
2Samadgjm
3davebehkn
4mikecfilo
Sheet2



Formula in b2 copied across and down.

MikeWall 2020-04-02 1.xlsm
ABCDE
1LookupkeysItalyIrelandEuropeJersey
2Sam dm 
3dave en 
4mike fo 
Sheet1
Cell Formulas
RangeFormula
B2:E4B2=IFERROR(INDEX(Sheet2!$B$2:$F$4,ROWS(B$2:B2),MATCH(B$1,Sheet2!$B$1:$F$1,0)),"")
 
Upvote 0
is there a way to download your file?
Create a new file with Sheet1 and Sheet2 then click this icon
1585824743898.png

on each sheet in my post & paste into Excel on the same top left cell in each sheet
 
Upvote 0
I didnt get the above to work. is there a way to download your file?

Edit -

I have played around with this. much appreciated

In sheet one, my title would be fixed but my look up keys can be different. In sheet two, headers will have same title as sheet 1, but the columns could change from day to day.

I want to match look up keys in sheet one to sheet 2, then match column headers in sheet one vs sheet 2 - then return the corresponding columns based on the lookup keys.
 
Upvote 0
As far as I can understand what you are saying, I thought that is what my formulas do.
You didn't actually post any sample data or expected results.
In what way is my sample data or results not what you have or want?
Perhaps you could actually post some sample data and expected results with XL2BB
 
Upvote 0
As far as I can understand what you are saying, I thought that is what my formulas do.
You didn't actually post any sample data or expected results.
In what way is my sample data or results not what you have or want?
Perhaps you could actually post some sample data and expected results with XL2BB


Apologies, yes I see this now. How is the match using the lookup keys working?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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