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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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
1123NameItemHeader
2TommyBreadMilkEggsTommyMilk2
3JohnnyEggsMilkBread
4MikeyMilkBreadEggs

<tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
H2=INDEX($B$1:$D$1,MATCH(G2,INDEX($B$2:$D$4,MATCH(F2,$A$2:$A$4,0),0),0))

<tbody>
</tbody>

<tbody>
</tbody>
 
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,215,029
Messages
6,122,755
Members
449,094
Latest member
dsharae57

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