+ Reply to Thread
Results 1 to 17 of 17

Name Matching

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Name Matching

    Here I have a spreadsheet that contains three columns of names. Each column has different lengths of data and the name format is not the same across the board. Two of the lists list the last name first and the the main list I am looking at (the middle one) shows the first name first.

    If it is possible, I need to find a way to see which names on the third list appear on the first two. Is that possible when the format is not the same for all columns? If so, an app or formula would be appreciated. Example List.xlsx

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Name Matching

    This formula in D1, copied down will find if the name appears in column A....

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Name Matching

    Put this formula in D1:

    =IF(C1="","",IF(ISNA(MATCH(RIGHT(C1,LEN(C1)-SEARCH(",",C1)-1)&" *"&LEFT(C1,SEARCH(",",C1)-1),B:B,0)),IF(ISNA(MATCH(SUBSTITUTE(C1," ","")&"*",A:A,0)),"Not present","List A"),"List B"))

    then copy down to the bottom of your data in column C.

    Note that your list in column A generally has surname,forname initial, whereas the names in column C do not have the initial, so the inner MATCH function looks for a partial match (and removes the space after the comma). The outer MATCH function rearranges the name and looks at column B for a partial match, with possibly an initial after the first name.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    12-15-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Name Matching

    Hi guys slightly different approach:

    =LARGE(IF(ISERROR(FIND(LEFT(C1,FIND(",",C1)-1),$A$1:$A$1121)),0,ROW($A$1:$A$1121))*IF(ISERROR(FIND(RIGHT(C1,LEN(C1)-FIND(",",C1)-1),$A$1:$A$1121)),0,ROW($A$1:$A$1121))/ROW($A$1:$A$1121),1)

    Unfortunately, none of our solutions are getting around case at the moment

    Will keep trying.
    If I helped you today please rate me

  5. #5
    Registered User
    Join Date
    06-13-2012
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Name Matching

    Thanks people, for all your help! I'm using Pete's formula, and I have a question. If an item on C is on both A and B, will the formula say so?
    Last edited by Spartan1138; 06-13-2012 at 10:52 AM.

  6. #6
    Registered User
    Join Date
    12-15-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Name Matching

    Ok now this one is not case sensitive:

    =LARGE(IF(ISERROR(FIND(LOWER(LEFT($C1,FIND(",",$C1)-1)),LOWER(A$1:A$1121))),0,ROW(A$1:A$1121))*IF(ISERROR(FIND(LOWER(RIGHT($C1,LEN($C1)-FIND(",",$C1)-1)),LOWER(A$1:A$1121))),0,ROW(A$1:A$1121))/ROW(A$1:A$1121),1)

    However, as Pete pointed out, it will also find "christopher davis" when you are looking for "chris davis". Don't know if you actually want that though.

    Sorry, mine is not quite as elegant as the other two, so you need to drag it over 2 columns. At the moment it just returns the row number but you could always wrap it in an IF function.

    Good Luck!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Name Matching

    Quote Originally Posted by Spartan1138 View Post
    Thanks people, for all your help! Keep at it!
    What is wrong with the first 2 solutions supplied above?

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Name Matching

    Quote Originally Posted by Spartan1138 View Post
    Thanks people, for all your help! I'm using Pete's formula, and I have a question. If an item on C is on both A and B, will the formula say so?
    No, my formula looks first at column B to find a match (as you said that was the main list), then it looks at column A, and if there is no match then it returns "Not Present". There didn't seem to be any point in seeing if it was in BOTH lists.

    Hope this helps.

    Pete

  9. #9
    Registered User
    Join Date
    06-13-2012
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Name Matching

    I was referring to the case sensitivity, but aside from that, absolutely nothing. Thanks guys!

  10. #10
    Registered User
    Join Date
    06-13-2012
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Name Matching

    That's even better. Thank you!

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Name Matching

    If you use:

    Please Login or Register  to view this content.
    This will give TRUETRUE if in both, TRUEFALSE if in column A only, FALSETRUE if in column B only, and FALSEFALSE if not in any of A or B....

  12. #12
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Name Matching

    Hi Imvk99,

    why do you use FIND (which is case-sensitive) and then convert everything to LOWER, when you can use SEARCH (which is not case-sensitive, and which allows you to use wildcards if you wish)?

    Pete

  13. #13
    Registered User
    Join Date
    12-15-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Name Matching

    Quote Originally Posted by Pete_UK View Post
    Hi Imvk99,

    why do you use FIND (which is case-sensitive) and then convert everything to LOWER, when you can use SEARCH (which is not case-sensitive, and which allows you to use wildcards if you wish)?

    Pete
    Good point, bad habit

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Name Matching

    Quote Originally Posted by lmvk99 View Post
    Good point, bad habit
    It's just that I generally do not use FIND because of that restriction, and only use it where case is important.

    Incidentally, MATCH is not case-sensitive either, so your point doesn't apply to the first two solutions.

    Pete

  15. #15
    Registered User
    Join Date
    12-15-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Name Matching

    Wierd. Cos when I tested it I found it missed an entry that was all CAPS, I just assumed it was a case issue.

  16. #16
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Name Matching

    Quote Originally Posted by Spartan1138 View Post
    Thanks people, for all your help! If an item on C is on both A and B, will the formula say so?
    If you really want this, then you could use this variation of my original formula:

    =IF(C1="","",SUBSTITUTE(SUBSTITUTE(IF(ISNA(MATCH(SUBSTITUTE(C1," ","")&"*",A:A,0)),"-","List A ")&IF(ISNA(MATCH(RIGHT(C1,LEN(C1)-SEARCH(",",C1)-1)&" *"&LEFT(C1,SEARCH(",",C1)-1),B:B,0)),"-","List B"),"--","Absent"),"-",""))

    which will give you the options of "List A", "List "B", "List A List B" or "Absent".

    If you want the matching items to stand out and not have the word "Absent", you can use this slightly simpler formula:

    =IF(C1="","",IF(ISNA(MATCH(SUBSTITUTE(C1," ","")&"*",A:A,0)),"","List A ")&IF(ISNA(MATCH(RIGHT(C1,LEN(C1)-SEARCH(",",C1)-1)&" *"&LEFT(C1,SEARCH(",",C1)-1),B:B,0)),"","List B"))

    However, these formulae do mean that you have to lookup against two lists all the time, so the formula could take longer to execute.

    Anyway, hope this helps - is the thread Solved now?

    Pete

  17. #17
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Name Matching

    Quote Originally Posted by lmvk99 View Post
    Wierd. Cos when I tested it I found it missed an entry that was all CAPS, I just assumed it was a case issue.
    With so many names, I don't know how you would have spotted that. Can you remember which name it was?

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1