Vlookup with multiple criteria

rhmkrmi

Active Member
Joined
Aug 17, 2012
Messages
341
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Is there a way I can use VLOOKUP based on two criteria in two separate columns other than creating a columns with concatenated values as lookup?
I need to check a value in column A and then another one in column B to find the right match in column C.

Thank you.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
One way

Book1
ABCDEFG
1Name1Name2ValueName1Name2RESULT
2JohnSmith1MickeyMouse5
3JohnPeters2
4JohnJames3
5JessieJames4
6MickeyMouse5
7MinnieMouse6
8JohnMouse7
Sheet1
Cell Formulas
RangeFormula
G2G2=INDEX(C:C,MATCH(E2&F2,A:A&B:B,0))
 
Upvote 0
If using INDEX/MATCH by concatenating values, I would suggest a couple of changes ..
  • I would not use whole columns as joining over a million values is relatively slow so if there are a lot of these formulas in a worksheet they could start to impact the performance speed of the sheet.
  • Add a delimiter just in case a circumstance like below might arise and a wrong result occurs as happens in G2.
Depending on your Excel version, you may need to confirm these formulas with Ctrl+Shift+Enter, not just Enter.

20 07 06.xlsm
ABCDEFGH
1Name1Name2ValueName1Name2RESULTRESULT
2JohnSmith1MickeyMouse25
3MickEymouse2
4JohnJames3
5JessieJames4
6MickeyMouse5
7MinnieMouse6
8JohnMouse7
9
10
Lookup
Cell Formulas
RangeFormula
G2G2=INDEX(C:C,MATCH(E2&F2,A:A&B:B,0))
H2H2=INDEX(C2:C10,MATCH(E2&"|"&F2,A2:A10&"|"&B2:B10,0))



@rhmkrmi
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
For example, the suggestion in column H below requires Excel 365.

So, a couple of other alternatives if you don't want to concatenate the values are:

20 07 06.xlsm
ABCDEFGH
1Name1Name2ValueName1Name2RESULTRESULT
2JohnSmith1MickeyMouse55
3MickEymouse2
4JohnJames3
5JessieJames4
6MickeyMouse5
7MinnieMouse6
8JohnMouse7
9
10
Lookup (2)
Cell Formulas
RangeFormula
G2G2=INDEX(C$2:C$10,AGGREGATE(15,6,(ROW(C$2:C$10)-ROW(C$2)+1)/((A$2:A$10=E2)*(B$2:B$10=F2)),1))
H2H2=INDEX(FILTER(C$2:C$10,(A$2:A$10=E2)*(B$2:B$10=F2)),1)
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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