Check for the existence of one of two columns, and select the one that does exist?

mikemck

New member
Joined
Jan 14, 2019
Messages
18
Reaction score
0
Points
0
Excel Version(s)
2016
I have a series of query's that are set up to select a specific column, but now that column has changed. This of course broke pretty much every report I was generating with these queries.

What I need to do is check for the existence of one of two columns, and select the one that does exist

In my case, the two columns name are WO number or WO ID.

Any help would be greatly appreciated.
 
You could use try error handling

Code:
Table.AddColumn(Source, "Custom", each try [WO] otherwise [WO ID])
 
Ah, I'll try that. Thank you very much indeed.
 
Back
Top