Lookup up column and row header matches and return corresponding data

pacerfan07

New Member
Joined
Jun 2, 2017
Messages
20
I have a table on sheet1 that looks like the table below. On sheet2 cell A1 is "ATL" and cell B1 is "Yellow" How to I matchup the sheet2 values with sheet1 so that the formula would return "40" based on this example? Thanks!

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]Orange[/TD]
[TD]Yellow[/TD]
[TD]Black[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]ATL[/TD]
[TD]60[/TD]
[TD]40[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]MIA[/TD]
[TD]20[/TD]
[TD]50[/TD]
[TD]80[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]BKN[/TD]
[TD]70[/TD]
[TD]30[/TD]
[TD]40[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
While the suggestion in post #3 will work, I would advise against using full-column references with v/hlooup, it could slow your file down. Below is a more efficient method...
Data sheet6
[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][/tr]
[tr][td]
1​
[/td][td][/td][td]Orange[/td][td]Yellow[/td][td]Black[/td][/tr]

[tr][td]
2​
[/td][td]ATL[/td][td]60[/td][td]40[/td][td]30[/td][/tr]

[tr][td]
3​
[/td][td]MIA[/td][td]20[/td][td]50[/td][td]80[/td][/tr]

[tr][td]
4​
[/td][td]BKN[/td][td]70[/td][td]30[/td][td]40[/td][/tr]
[/table]


extract sheet...
[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][/tr]
[tr][td]
1​
[/td][td]ATL[/td][td]
40​
[/td][/tr]

[tr][td]
2​
[/td][td]Yellow[/td][td][/td][/tr]
[/table]

B1=INDEX(Sheet6!$B$2:$D$4,MATCH($A$1,Sheet6!$A$2:$A$4,0),MATCH($A$2,Sheet6!$B$1:$D$1,0))
 
Upvote 0
Yellow should be in B2.

I referenced the full columns etc so that it allows the table to grow without need to change the formulae.
I like your method too though
 
Upvote 0
Yellow should be in B2.

I referenced the full columns etc so that it allows the table to grow without need to change the formulae.
I like your method too though

1. Based on the sample above, column B is Orange, not yellow
2. You can still use a defined range, using something like 2-3 times more than you think you would need. Even a range of 5000 rows is still better than 1 million+ rows that full-column references would use. Also, INDEX/MATCH is more efficient than H/VLOOKUP.

If you want the formula to grow as the data range increases, maybe consider using a Structured Table for the data

3. Thanks for the input :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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