Multi Variable search in a table to return a header

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I posted my original question here: https://stackoverflow.com/questions/30859366/how-to-return-a-header-in-excel-vlookup-and-hlookup but i will ask it again.


I am trying to do a multi variable search within a table to return the header.

Any help would be awesome.

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
L​
1​
-NPBa1Ba2NG1G2
2​
T2
0%​
0%​
0%​
10%​
30%​
60%​
100%​
B2
37%​
Ba2
3​
T1
0%​
1%​
6%​
21%​
50%​
80%​
100%​
A
93%​
G2
4​
A
0%​
2%​
12%​
32%​
72%​
90%​
100%​
5​
B1
0%​
2%​
22%​
62%​
82%​
95%​
100%​
6​
B2
0%​
5%​
45%​
75%​
95%​
100%​
100%​

L2, copied down:

=LOOKUP($K2,INDEX($A$1:$H$6,MATCH($J2,$A$2:$A$6,0),0),$B$1:$H$1)
 
Upvote 0
That is Brilliant! Thanks so much. Now to figure out how it works, but that is amazing. I spent like 4 hours trying to piece it together.
 
Upvote 0
Hello,

Believe Aladin made a tiny typo for the match ...MATCH($J2,$A$1:$A$6,0) .. to account for T2 ...
 
Upvote 0
Hello,

Believe Aladin made a tiny typo for the match ...MATCH($J2,$A$1:$A$6,0) .. to account for T2 ...

Meant:

=LOOKUP($K2,INDEX($A$2:$H$6,MATCH($J2,$A$2:$A$6,0),0),$B$1:$H$1)

That is Brilliant! Thanks so much. Now to figure out how it works, but that is amazing. I spent like 4 hours trying to piece it together.

You are welcome.

The INDEX bit calculates the range related to the value of J2. Once that range is known, LOOKUP seeks the value of K2 in that range and correlates the search result with the header range. hope this helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,253
Members
448,556
Latest member
peterhess2002

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