vlookup and match 1 more column & then pull value of another column

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,215
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
Sheet1 is input & Sheet2 is output.
Sheet1:
A2-A9999=alphanumeric values
B2-B9999=alphanumeric values (example: ENGLAND, USA, GERMANY, etc)
Sheet2:
C2-C9999=alphanumeric values
D2-D9999=alphanumeric values (example: ENGLAND)
E2-E9999=i want respective M2-M9999 column of Sheet1 using vlookup on Sheet1 (Table_Array=A2-M9999), Lookup_value=Sheet2 C2-C9999 provided D2-D9999 also matches exactly with B2-B9999.

Thanks for help.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Sheet1 is input & Sheet2 is output.
Sheet1:
A2-A9999=alphanumeric values
B2-B9999=alphanumeric values (example: ENGLAND, USA, GERMANY, etc)
Sheet2:
C2-C9999=alphanumeric values
D2-D9999=alphanumeric values (example: ENGLAND)
E2-E9999=i want respective M2-M9999 column of Sheet1 using vlookup on Sheet1 (Table_Array=A2-M9999), Lookup_value=Sheet2 C2-C9999 provided D2-D9999 also matches exactly with B2-B9999.

Thanks for help.

I guess you mean...

E2, Sheet2
Rich (BB code):
=INDEX(Sheet1!$M$2:$M$9999,
  MATCH(1,IF(Sheet1!$A$2:$A$9999=C2,IF(Sheet1!$B$2:$B$9999=D2,1)),0))
which must be confirmed with control+shift+enter, not just enter.
 
Upvote 0
As always,
WORKS. Thanks.
Can it be without control+shift+enter
 
Upvote 0
Maybe non-CSE
Code:
=INDEX(Sheet1!$M$2:$M$9999,MATCH(1,INDEX((Sheet1!$A$2:$A$9999=C2)*(Sheet1!$B$2:$B$9999=D2),,1),0),1)
 
Upvote 0
As always,
WORKS. Thanks.

You are welcome.


Can it be without control+shift+enter

By introducing another IINDEX which captures the result of conditional terms, you can avoid confirmation with CSE:
Code:
[SIZE=2][FONT=lucida console]=INDEX(Sheet1!$M$2:$M$9999,
MATCH(1,INDEX((Sheet1!$A$2:$A$9999=C2)*(Sheet1!$B$2:$B$9999=D2),0),0))[/[/FONT][/SIZE]code]

a technique I should never have introduced around here for it thwarts learning array-processing formulas and it's probably a bit more expensive that the formula it replaces. By the way, the formula is still an array type of formula.
 
Upvote 0
Sheet1 is input & Sheet2 is output.
Sheet1:
A2-A9999=alphanumeric values
B2-B9999=alphanumeric values (example: ENGLAND, USA, GERMANY, etc)
Sheet2:
C2-C9999=alphanumeric values
D2-D9999=alphanumeric values (example: ENGLAND)
E2-E9999=i want respective M2-M9999 column of Sheet1 using vlookup on Sheet1 (Table_Array=A2-M9999), Lookup_value=Sheet2 C2-C9999 provided D2-D9999 also matches exactly with B2-B9999.

Thanks for help.
Here's another one...

Array entered**:

=INDEX(Sheet1!M2:M9999,MATCH(D2,IF(Sheet1!A2:A9999=C2,Sheet1!B2:B9999),0))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,818
Members
449,469
Latest member
Kingwi11y

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