Condition two options, Vlookup 2 worksheets

sitzalke

New Member
Joined
May 13, 2019
Messages
11
Hi, good evening everyone.

I would like to ask question that I've been stuck for a very long time, so I made a decision to ask in this forum.
Roughly, I have TWO(2) worksheets. One sheet is Onhand, another sheet is input.

This is table for sheet Onhand,
Column AColumn BLoc
ChickenMV1
FishMV2
RabbitMv3
ButterflyMv4

<tbody>
</tbody>


This is table for sheet input, in this sheet input, there are TWO(2) tables.

This table 1 is, if Column A in Sheet Onhand = Chicken Or Fish
SlocLoc
Mv1alien
mv2alien
mv3tupper
mv4cheese

<tbody>
</tbody>

This table 2 is, if Column A in Sheet Onhand = Butterfly OR Rabbit
SlocLoc
Mv1alien
mv2alien
mv3tupper
mv4cheese

<tbody>
</tbody>


My question is,
I need to do,
if (Column A in Sheet OnHand = chicken OR Column A = Fish), then Column "Loc" will VLOOKUP with table 1.
if (Column A in Sheet OnHand = Butterfly OR Column A = Rabbit), then Column "Loc" will VLOOKUP with table 2.

Help me,...
I'm not sure how to vlookup with so many options with two table. I've try so many type of vlookup, but doesn't work. T_T

Thankyou in advance! :)
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
This should work:

=VLOOKUP(B2,CHOOSE(LOOKUP(A2,{"Butterfly","Chicken","Fish","Rabbit"},{2,1,1,2}),Table1,Table2),2,0)
 
Upvote 0
This should work:

=VLOOKUP(B2,CHOOSE(LOOKUP(A2,{"Butterfly","Chicken","Fish","Rabbit"},{2,1,1,2}),Table1,Table2),2,0)

Oh, Sorry but I already found the solution. Thanks, The solution is like this,

Code:
=IF(OR(E2="Chicken",E2="Fish"),VLOOKUP(M2,LOC!A:B,2,0),VLOOKUP(M2,LOC!D:E,2,0))
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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