Double column VLOOKUP

gyoung

New Member
Joined
Mar 25, 2002
Messages
1
I need to do a function like VLOOKUP but two colums of data needt to match, then return
the data from the third column.

I have a look up table in this format:
Last Name|First Name| Org|

The spreadsheet being loaded with "ORG" info
has the same format, but there are multiple
entries of last & first names.

I cannot use the standard VLOOKUP because I
have people with the same last names, or the
same first names. ie: I need to match both
before the "ORG" is laoded to the spreadsheet.

Any help would be appreciated.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
The way I've gotten aroound this in the past is creating another column that concatinates the Lname and Fname, and then looks up that new column. If Lname and Fname were in Columns B and C, the formula (in Column A) would be +B1&C1 .....OR you could add a Comma Separator with +b1&", "&C1
Hope this isn't overly simplistic for you.
 
Upvote 0
On 2002-03-26 10:34, gyoung wrote:
I need to do a function like VLOOKUP but two colums of data needt to match, then return
the data from the third column.

I have a look up table in this format:
Last Name|First Name| Org|

The spreadsheet being loaded with "ORG" info
has the same format, but there are multiple
entries of last & first names.

I cannot use the standard VLOOKUP because I
have people with the same last names, or the
same first names. ie: I need to match both
before the "ORG" is laoded to the spreadsheet.

Any help would be appreciated.

Two possible solutions:

1. Create a 4th column in the sheet where everything is. Supposing that A2:C100 houses the data of interest in sheet Data:

In D2 enter and copy down as far as needed:

=A2&"-@-"&B2

where A2 holds a last name and B2 a first name.

In the sheet,called Main say, where you want to retrieve the associated ORG values from Data, use the following formula:

=IF(COUNTIF(Data!$D$2:$D$100,A2&"-@-"&B2),INDEX(Data!$C$2:$C$100,MATCH(A2&"-@-"&B2,Data!$D$2:$D$100,0)),"Not found")

2.

In Main just use:

=IF(SUMPRODUCT(ISNUMBER(MATCH(A2&"-@-"&B2,Data!$A$2:$A$100&"-@-"&$Data!B$2:$B$100,0))+0),INDEX(Data!$C$2:$C$100,SUMPRODUCT(MATCH(A2&"-@-"&B2,Data!$A$2:$A$100&"-@-"&$Data!B$2:$B$100,0))),"Not Found")

Note. Method 1 trades off space against time, therefore faster. Method 2 will incur some performance costs (that's, it will cause recalculation at opening and closing of your WB -- time costs).
 
Upvote 0

Forum statistics

Threads
1,214,414
Messages
6,119,375
Members
448,888
Latest member
Arle8907

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