multiple conditions vlookup...

engine22

Board Regular
Joined
Jul 5, 2007
Messages
62
I want to create a vlookup formula that will look for a value in column A, then another value in column B to return the value in column C. Here is a simplify version of my table:

A B C
1 urban local 10
2 urban collector 20
3 rural local 30
4 rural collector 40


let say i want to find the value when my road 1 is a rural collector...

Inventory:

X Y Z
1 name environtment roadtype
2 1 rural collector
...

how could i create a formula to do so... without using "if" because my table is much larger than this one...

maybe an index/match combo could work???

thank you in advance
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
IO have been trying to use your code but i always get a name error... maybe im not recording the vba appropriately... i right click on my tab...view code...then i paste your code in...after????
 
Upvote 0
Brian's code should go in a standard module (ALT+F11, Insert>Module), not a worksheet module.
 
Upvote 0
thanks noirie I am real close to i now...it works in the workbook where i am using the data but it doesnt work it the workbook i wanna use the formula
 
Upvote 0
ok i got it to work!!! i had to modules lookup2 in one workbook... i just had to delete the first one a created in one workbook...thanks to both of you its appreciated... nice function brian
 
Upvote 0
I want to create a vlookup formula that will look for a value in column A, then another value in column B to return the value in column C. Here is a simplify version of my table:

A B C
1 urban local 10
2 urban collector 20
3 rural local 30
4 rural collector 40


let say i want to find the value when my road 1 is a rural collector...

Inventory:

X Y Z
1 name environtment roadtype
2 1 rural collector
...

how could i create a formula to do so... without using "if" because my table is much larger than this one...

maybe an index/match combo could work???

thank you in advance

Assuming your criteria are in Y2 (="rural") and Z2 (="collector")

=INDEX($C$1:$C$4,MATCH(1,INDEX((A1:A4=Y2)*(B1:B4=Z2),0),0))
 
Upvote 0
Man I new there was a way, I just never have been able to the the formula to work the route I was taking... Thank you Patsys!
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

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