Home

Power Query Vlookup Dynamic Column Reference

Highlighted
Nathan88
Occasional Visitor

I have a query where Column "INDEX" values are the header names of other columns. I want to return the matching value. How can i do this in Power Query? Its basically a Vlookup with a dynamic col_index_num. I cannot seem to find a solution.. Thank you for the help!

 

 

2 Replies

I'm moving your question to the Excel community for better visibility.

In query on second table select KEY column, Unpivot other columns and add column with combined index. In query on first table create same combined index (KEY & "any text/symbol which is definitely not in your names" & INDEX), merge on it with second table and expand values only.

 

Please check attached.

Related Conversations
Creating A Sublist
zjohnson in Excel on
5 Replies
Custom value if a value is found using vlookup
Sam55 in Excel on
5 Replies
Sorting problem with imported data from query
DenisL in Excel on
5 Replies
Excel web query DataFormat.Error "not a valid path"
Simon Pearce in Excel on
7 Replies
vlookup using concatenate function and helper column
Angela McGhin in Excel on
4 Replies
Vlookup doesn't work for inexplicable reason
Domonkos in Excel on
2 Replies