look up 2 criteria and return column header

jalifid11

Board Regular
Joined
Nov 17, 2006
Messages
168
So, in my head, this is a little different that a standard Index/Match formula..


I have a name in one column and an answer in another column... the column headers have numbers in each..

What I'm trying to do is match the name, and the answer, and then tell me what the column header is..

1 2 3
Tommy Bread Milk Eggs
Johnny Eggs Milk Bread
Mikey Mile Bread Eggs


So if I was looking for Tommy and Bread, it should return the 2... Because Tommy and Milk are on the same line and it's in the #2 column
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I don't quite understand what you are trying to do with your look up ( I can't see if you are looking for tommy and Bread that milk has got anything to do with it) However with a simple match just looking for one item you can get the heading using this formula:
=OFFSET(A1,0,MATCH(A7,A3:D3,0)-1)
 
Last edited:
Upvote 0
If I understand correctly, then something like this:

ABCDEFGHI
NameItemHeader
TommyBreadMilkEggsTommyMilk
JohnnyEggsMilkBread
MikeyMilkBreadEggs

<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"][/TD]

[TD="align: right"]2[/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet3

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]H2[/TH]
[TD="align: left"]=INDEX($B$1:$D$1,MATCH(G2,INDEX($B$2:$D$4,MATCH(F2,$A$2:$A$4,0),0),0))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I don't quite understand what you are trying to do with your look up ( I can't see if you are looking for tommy and Bread that milk has got anything to do with it) However with a simple match just looking for one item you can get the heading using this formula:
=OFFSET(A1,0,MATCH(A7,A3:D3,0)-1)


Thanks...

Milk doesn't have to do with anything, yet... But if I changed the criteria to look up Tommy and Milk, then it would return whatever the column name was for that one...
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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