SOLVED

How to retrieve column header based on lookup

Copper Contributor

Hi,

Can you help me find a way to return the column header from multiple columns by looking up a value in another column?

So basically i want to fill-up the Column "N" by the names in the columns F, I and L by looking up the M column and finding the matching values in F, I and L columns.

 

Somebody please help me :)

7 Replies
best response confirmed by allyreckerman (Microsoft)
Solution

@murtaza88 Hi. I would in this case suggest SWITCH;

N2 =SWITCH(M2,F2,F$1,I2,I$1,L2,L$1)

 

@bosinander thanks for your help.. it works for me :)

@murtaza88 Good. You're welcome :)

Hi @bosinander .. i needed help in also pulling up the header name of the 2nd lowest price in the next column. can that be done too?

@murtaza88 

 

Repeat the values in a contiguous range, column P to R.

Find the 2nd smallest value;

=SMALL(P2:R2;2)

Repeat the SWITCH in column T.

bosinander_0-1634202688007.png

 

@bosinander I tried to do it myself by copying your SWITCH formula but it gives a wierd problem. it gives an error only where "CAP Net" column header is supposed to be retrieved.

@murtaza88 Hi - You were quite close :) but I fixed it as a table and included the formulas as column formulas on the first sheet.

Using the tables column names may make it easier for you, being familiar with the table.

 

1 best response

Accepted Solutions
best response confirmed by allyreckerman (Microsoft)
Solution

@murtaza88 Hi. I would in this case suggest SWITCH;

N2 =SWITCH(M2,F2,F$1,I2,I$1,L2,L$1)

 

View solution in original post