Vlookup based on 2 conditions

bat18

Board Regular
Joined
Mar 29, 2010
Messages
89
Hi,

I am looking to do a vlookup based on 2 conditions and have no idea how to do it.

At the moment I am doing a vlookup on a cell in column A and it is producing a particular value, the problem is that this cell appears a few times in column A. So what I need to do is lookup the cell in column A but also based on the corresponding data in column B to get the correct lookup value.

For example

2109 Dave
2109 John
2108 Dave

So at the moment when I am looking up 2109 it is always producing the value corresponding to what Dave has put in, I need to know what both Dave and John have put in

I hope this made some sense, any help would be truly appreciated.

Thanks
 

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 requires an INDEX/MATCH formula:
Excel Workbook
ABCDEF
12109DaveAppleNumber to Lookup2109
22109JohnOrangeName to LookupJohn
32108DaveOrangeValue ReturnedOrange
Sheet1
Excel 2003
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
 
Upvote 0
MrKowz, something you might like

{=INDEX(C1:C3,MATCH(1,--IF(A1:A3=F1,B1:B3=F2),0))}
 
Upvote 0
MrKowz, something you might like

{=INDEX(C1:C3,MATCH(1,--IF(A1:A3=F1,B1:B3=F2),0))}

Good find for when there is only two conditions. However, a problem would arise if there is three or more. :biggrin:
 
Upvote 0
Thanks for the help, but I'm not getting any luck with it at the minute. This may be because I am looking up values from a different spreadsheet??

My formula looks something like this

=INDEX('[ACR P9, 2010.xls]Summary ACR'!$V7:$V500, MATCH(1, IF('[ACR P9, 2010.xls]Summary ACR'!$A7:$A500=A23, IF('[ACR P9, 2010.xls]Summary ACR'!$E7:$E500=E23, 1)), 0))

I am trying to find a value in column V of a different worksheet based on the criteria in columns A and E of the worksheet I'm in now.

The values in columns E I have obtained using a vlookup from the other spreadsheet, would this cause problems

Thanks again for the help
 
Upvote 0
You weren't meant to notice that

{=INDEX(D1:D3,MATCH(1,--IF(A1:A3=F1,IF(B1:B3=F2,C1:C3=F3)),0))}

I've always used sumproduct and small to do this task, but this method looks more efficient :)
 
Upvote 0
Did you confirm formula entry with CTRL+SHIFT+ENTER? Your formula looks fine.
 
Upvote 0
No I did not and now it works prefectly. I owe you my largest THANKYOU of the week!!
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,537
Members
449,316
Latest member
sravya

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