Tables - refer to range with specific column title

sauzee

New Member
Joined
Aug 24, 2017
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hi all - I have a table linked to external data. Unfortunately, the order of the columns change often when new columns are added/delete.

I'm using table references, for example "table1[date]" to refer to the date column. I thought that this reference would update to wherever the date column is moved to. But it basically is still a cell reference. For example, if date is in column A, it will always refer to column A, even if the date column moved to B.

Is there any easy to move these references as a column moves? It seems like an obvious missing feature and not much of an improvement of cell references other than making it more legible.

I understand I could use INDEX/MATCH or INDIRECT to find the column title but I'm working with quite a big dataset that is already quite slow and don't think it could cope with these formulas (lots of averageifs!). I'm guessing there's probably a way to "freeze" the column order in power query but I'm curious to find whether there's an easy way (such as an add-in) that anyone has discovered or knows about?

Thanks in advance
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
When using structured references like Table1[Date] in a formula, the formula will always look at the Date column regardless of where it's moved to.
 
Upvote 0
Hi Fluff- thanks for the reply. Yes that would be the way I would expect it to work. However, it seems that only happens when the table is edited within excel. For example, if I delete a column from a table in excel, the table reference will continue to lookup the correct column. However, it seems if the data comes from an external data source, such as a web query or a sql database, then the table reference will edit to whatever the new column title is within that excel cell reference (e.g. column B). I'm guessing this is a bug then
 
Upvote 0
I've never dealt with data coming from external sources, so cannot help with that.
Hopefully another member will be able to offer help.
 
Upvote 0
It is annoying. Usually the simplest solution is to right-click the table, choose external data properties, and check the option to 'preserve column sort/filter/layout' - assuming you don't mind the table order being preserved even if you reorder the columns in PQ.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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