Vlookup Formula with 2 conditions

Hi,
Can you help me with a Vlookup formula for 2 conditions
example:

                           lookup table (value)
                                         
                               cat      0     25
                               cat      1     50
                               cat      3     80
                               dog     0     11
                               dog     1     27
                               dog     7     56

what is value for cat 1      answer 50
what is value for dog 0     answer  11

Many thanks

Ian
raceproretiredAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Roy CoxGroup Finance ManagerCommented:
VLOOKUP will only find the first match, but using a hidden helper column is probably the simplest way

Here's an explanation of using Index/Match as an array formula

INDEX and MATCH with multiple criteria
Formula.xlsx
1
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Hi Ian,

There is no need for a helper column. You may try this formula...

=IFERROR(INDEX($C$2:$C$7,MATCH(E2&F2,INDEX($A$2:$A$7&$B$2:$B$7,),0)),"")

Open in new window

Refer to the attached for more details.
IndexMatch.xlsx
1
raceproretiredAuthor Commented:
Hi Neeraj,

I have attached a spreadsheet hopefully it makes it clearer
Thanks
Ian
lookup2conditions.xlsx
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Hi Ian,

Try this to see if this is what you are trying to achieve...

In B14
=IFERROR(INDEX($T$14:$T$4203,MATCH(B$13&$V$14,INDEX($R$14:$R$4203&$S$14:$S$4203,0),0)),"")

Open in new window

and then copy across.
lookup2conditions.xlsx
1
raceproretiredAuthor Commented:
Not quite right yet Neeraj.
I've attached the sheet with data V14:AK14 same as row 15. This is the data we are looking at.
Therefore row data B14:Q14 and B15:Q15 should also be the same.
I have placed the correct returned values in black in row 15
thanks
lookup2conditionsV2.xlsx
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
I hope I understood your requirement correctly.
Please try this...

In B14
=IFERROR(INDEX($T$14:$T$4203,MATCH(B$13&V14,INDEX($R$14:$R$4203&$S$14:$S$4203,0),0)),"")

Open in new window

Copy across and down.
lookup2conditionsV2.xlsx
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
raceproretiredAuthor Commented:
Seems to be a number of blank cells and all cells should have a value.
I have given a lookup  example on the attached sheet which I'm sure is an
improvement on my previous attempts.
Thanks for your continued patience
Ian
lookup2conditionsV3.xlsx
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
For formula in F16, the referenced cell Z16 has a number 8.5 actually while you see 9 in Z16 because of cell formatting. Select the cell Z16 and look at the formula bar, you will notice a number 8.5 underneath that cell and there is no combination of DILAC and 8.5 in the lookup data.
If you overwrite the Z16 with 9, the formula will return the output in F16.
Let me know if this is not the case.
1
raceproretiredAuthor Commented:
My apologies Neeraj, the data in the right columns should have been whole numbers. My mistake.
I haphazardly copied data from a wrong sheet.
All okay now.
Thanks a million, genius
Ian
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Ian!
No problem. Glad it is working as desired now.
Thanks for the feedback. :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.