Forum Discussion
Formula help for tables that columns may change positions
- May 07, 2024
Hello, try this:
=XLOOKUP(Q7,Table1[Title],CHOOSECOLS(Table1,MATCH("Report N.",Table1[#Headers],0)))You will only have to write the name of the column header of the values you want to return. Then, even if changes in columns are made, it will always find the value to return.
Attaching a sample document for you as well.
Martin
Hello, try this:
=XLOOKUP(Q7,Table1[Title],CHOOSECOLS(Table1,MATCH("Report N.",Table1[#Headers],0)))
You will only have to write the name of the column header of the values you want to return. Then, even if changes in columns are made, it will always find the value to return.
Attaching a sample document for you as well.
Martin
I need to do another one - I've got a cell named "Phase No" in I3 that I want to bring through all the column data into I4:I180 from a table that has the header name "Phase No". Is it an issue that the data in I3 isn't a table? I'd prefer not to change it to a table if possible, however the table that I'm pulling the data from needs to stay as a table.
- SergeiBaklanMay 08, 2024Diamond Contributor
If you use Power Query to get initial data from MS list, entire job could be done with Power Query without additional formulae.
- Martin_AngostoMay 08, 2024Iron Contributor
Glad it worked.
You can perfectly do that. It does not really matter if you are working with data from a table and data without a table. The formulation should work as well.