Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CraigS
 
Posts: n/a
Default Any way for 2 column vlookups. i.e match last name then match firs

The only complete matching information in both databases is last name and
first name. Database 2 is actually a smaller list pulling info from the
larger database 1. The second database needs to pull social security info
from databse 1 to put in database 2. Because of multiple last names
matching I first want to match the last name in database 1 but somehow then
have an "AND" statement that then requires a first name match at which point
it will pullout the SS # from the row where both last and first names match.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB
 
Posts: n/a
Default Any way for 2 column vlookups. i.e match last name then match firs

Assuming:
A1:A3 = First Names
B1:B3 = Last Names
C1:C3 = SS Numbers

F1 = First Name
G1 = Last Name

If the SS#'s are formatted as numbers you can use:
=SUMPRODUCT(--(A1:A3=F1),--(B1:B3=G1),C1:C3)

If formatted as text use an array formula (entered w/Control+Shift+Enter)
=INDEX(C1:C3,MATCH(F1&G1,A1:A3&B1:B3))

Change ranges as necessary.

"CraigS" wrote:

The only complete matching information in both databases is last name and
first name. Database 2 is actually a smaller list pulling info from the
larger database 1. The second database needs to pull social security info
from databse 1 to put in database 2. Because of multiple last names
matching I first want to match the last name in database 1 but somehow then
have an "AND" statement that then requires a first name match at which point
it will pullout the SS # from the row where both last and first names match.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CraigS
 
Posts: n/a
Default Any way for 2 column vlookups. i.e match last name then match

My SS# are TEXT. I tried itin the databases and got #VALUE as answer.

I then setup two new excel worksheets (i.e. Book1 and Book2) and set up your
little example using the Index formula and still got #VALUE. I also went
ahead and specifically formatted the SS# as TEXT so there was no issue there.
So i'm not sure exactly what is wrong.

"JMB" wrote:

Assuming:
A1:A3 = First Names
B1:B3 = Last Names
C1:C3 = SS Numbers

F1 = First Name
G1 = Last Name

If the SS#'s are formatted as numbers you can use:
=SUMPRODUCT(--(A1:A3=F1),--(B1:B3=G1),C1:C3)

If formatted as text use an array formula (entered w/Control+Shift+Enter)
=INDEX(C1:C3,MATCH(F1&G1,A1:A3&B1:B3))

Change ranges as necessary.

"CraigS" wrote:

The only complete matching information in both databases is last name and
first name. Database 2 is actually a smaller list pulling info from the
larger database 1. The second database needs to pull social security info
from databse 1 to put in database 2. Because of multiple last names
matching I first want to match the last name in database 1 but somehow then
have an "AND" statement that then requires a first name match at which point
it will pullout the SS # from the row where both last and first names match.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB
 
Posts: n/a
Default Any way for 2 column vlookups. i.e match last name then match

One thing that can cause that is by simply hitting Enter after typing in the
formula (which doesn't work for array formulas). As mentioned, you must hold
down the Control and Shift keys, then hit Enter. If done properly, Excel
will put braces { } around the formula.

Are you still getting an error? To clarify my earlier post, Index/Match
will work for either numbers or text, Sumproduct only works for numbers (it
is not an array formula, but it accepts array arguments).


"CraigS" wrote:

My SS# are TEXT. I tried itin the databases and got #VALUE as answer.

I then setup two new excel worksheets (i.e. Book1 and Book2) and set up your
little example using the Index formula and still got #VALUE. I also went
ahead and specifically formatted the SS# as TEXT so there was no issue there.
So i'm not sure exactly what is wrong.

"JMB" wrote:

Assuming:
A1:A3 = First Names
B1:B3 = Last Names
C1:C3 = SS Numbers

F1 = First Name
G1 = Last Name

If the SS#'s are formatted as numbers you can use:
=SUMPRODUCT(--(A1:A3=F1),--(B1:B3=G1),C1:C3)

If formatted as text use an array formula (entered w/Control+Shift+Enter)
=INDEX(C1:C3,MATCH(F1&G1,A1:A3&B1:B3))

Change ranges as necessary.

"CraigS" wrote:

The only complete matching information in both databases is last name and
first name. Database 2 is actually a smaller list pulling info from the
larger database 1. The second database needs to pull social security info
from databse 1 to put in database 2. Because of multiple last names
matching I first want to match the last name in database 1 but somehow then
have an "AND" statement that then requires a first name match at which point
it will pullout the SS # from the row where both last and first names match.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CraigS
 
Posts: n/a
Default Any way for 2 column vlookups. i.e match last name then match

Hi JMB

The Ctrl-Shft-Enter did the initial trick. I also figured out the original
database needs to be sorted on Column A. The one sticky wicket is on the
two database lists sometimes one or both names is spelled differently. With
VLOOKUP I had the option to end it with FALSE so if my search (I know only on
one column) didn't match exactly I would get an #N/A

Is there a way to modify our formula to do the same thing? This way when I
get an N/A I'm able to search the origianl database for the misspelled name
and correct it.

Craig

"JMB" wrote:

One thing that can cause that is by simply hitting Enter after typing in the
formula (which doesn't work for array formulas). As mentioned, you must hold
down the Control and Shift keys, then hit Enter. If done properly, Excel
will put braces { } around the formula.

Are you still getting an error? To clarify my earlier post, Index/Match
will work for either numbers or text, Sumproduct only works for numbers (it
is not an array formula, but it accepts array arguments).


"CraigS" wrote:

My SS# are TEXT. I tried itin the databases and got #VALUE as answer.

I then setup two new excel worksheets (i.e. Book1 and Book2) and set up your
little example using the Index formula and still got #VALUE. I also went
ahead and specifically formatted the SS# as TEXT so there was no issue there.
So i'm not sure exactly what is wrong.

"JMB" wrote:

Assuming:
A1:A3 = First Names
B1:B3 = Last Names
C1:C3 = SS Numbers

F1 = First Name
G1 = Last Name

If the SS#'s are formatted as numbers you can use:
=SUMPRODUCT(--(A1:A3=F1),--(B1:B3=G1),C1:C3)

If formatted as text use an array formula (entered w/Control+Shift+Enter)
=INDEX(C1:C3,MATCH(F1&G1,A1:A3&B1:B3))

Change ranges as necessary.

"CraigS" wrote:

The only complete matching information in both databases is last name and
first name. Database 2 is actually a smaller list pulling info from the
larger database 1. The second database needs to pull social security info
from databse 1 to put in database 2. Because of multiple last names
matching I first want to match the last name in database 1 but somehow then
have an "AND" statement that then requires a first name match at which point
it will pullout the SS # from the row where both last and first names match.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB
 
Posts: n/a
Default Any way for 2 column vlookups. i.e match last name then match

Yes, MATCH has an optional third argument that you can set. Sorry about
that, I inadvertently left it out of my example.

In the example from my earlier post, use 0 to specifiy it to match exactly.
Also, w/this option you won't need to sort the lists.

MATCH(F1&G1,A1:A3&B1:B3,0)

"CraigS" wrote:

Hi JMB

The Ctrl-Shft-Enter did the initial trick. I also figured out the original
database needs to be sorted on Column A. The one sticky wicket is on the
two database lists sometimes one or both names is spelled differently. With
VLOOKUP I had the option to end it with FALSE so if my search (I know only on
one column) didn't match exactly I would get an #N/A

Is there a way to modify our formula to do the same thing? This way when I
get an N/A I'm able to search the origianl database for the misspelled name
and correct it.

Craig

"JMB" wrote:

One thing that can cause that is by simply hitting Enter after typing in the
formula (which doesn't work for array formulas). As mentioned, you must hold
down the Control and Shift keys, then hit Enter. If done properly, Excel
will put braces { } around the formula.

Are you still getting an error? To clarify my earlier post, Index/Match
will work for either numbers or text, Sumproduct only works for numbers (it
is not an array formula, but it accepts array arguments).


"CraigS" wrote:

My SS# are TEXT. I tried itin the databases and got #VALUE as answer.

I then setup two new excel worksheets (i.e. Book1 and Book2) and set up your
little example using the Index formula and still got #VALUE. I also went
ahead and specifically formatted the SS# as TEXT so there was no issue there.
So i'm not sure exactly what is wrong.

"JMB" wrote:

Assuming:
A1:A3 = First Names
B1:B3 = Last Names
C1:C3 = SS Numbers

F1 = First Name
G1 = Last Name

If the SS#'s are formatted as numbers you can use:
=SUMPRODUCT(--(A1:A3=F1),--(B1:B3=G1),C1:C3)

If formatted as text use an array formula (entered w/Control+Shift+Enter)
=INDEX(C1:C3,MATCH(F1&G1,A1:A3&B1:B3))

Change ranges as necessary.

"CraigS" wrote:

The only complete matching information in both databases is last name and
first name. Database 2 is actually a smaller list pulling info from the
larger database 1. The second database needs to pull social security info
from databse 1 to put in database 2. Because of multiple last names
matching I first want to match the last name in database 1 but somehow then
have an "AND" statement that then requires a first name match at which point
it will pullout the SS # from the row where both last and first names match.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
Need rows in Column A removed if they fully or partially match with any Column B row [email protected] Excel Discussion (Misc queries) 1 August 21st 05 11:41 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM
Lookup then Match and insert value from next column Tenacity Excel Worksheet Functions 3 March 4th 05 02:49 AM


All times are GMT +1. The time now is 03:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"