+ Reply to Thread
Results 1 to 14 of 14

Vlookup or any other function to find, match and provide exact middle name from data

  1. #1
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Post Vlookup or any other function to find, match and provide exact middle name from data

    Hi I am trying to write a vlookup formula to find and match middle name of an employee from two different sets of data.

    =VLOOKUP($D2,Data1!$E$2:$G$36,2,FALSE)


    But no luck please see if I am doing anything wrong or there is a better way of doing it with some other functions in excel 2010. My formula is providing results but it not able to match the data properly.

    For ex - I have an employee whose name is Alan Peter Parker and there is another employee whose name is Dave Peter Patrick (just an example so pls ignore me for wrong combination of first & last name)

    No I have used LEFT, Right & Mid functions to separate data into First, Middle & Last name in 3 columns

    Now I have another set of data from different systems where the above employees have been setup too with the same names, the only difference is that Alan Peter Parker is setup as Alan Parker.

    Now I am trying to figure out a formula using vlookup, index & match functions to try find Peter as middle name in these two set of data so that I can filter then and check which one's are missing there middle names so that we can update the data in the system.

    Now the problem is coming is when I do my vlooup on middle name = Peter and lookup range = first name, last name, middle name & retun middle name as a result it gives me #N/A (might be bcoz of missing middle name) and the other cell says Peter but in front of Alan as it can check whether Peter is with Alan or Dave .


    =VLOOKUP($D2,Data1!$E$2:$G$36,2,FALSE)


    How to over come this issue.

    Excel spreadsheet attached to play with it.

    Thank you




    Vlookup or any other function to find, match and provide exact middle name from two different set of data.
    Attached Files Attached Files
    Last edited by aoberoi83; 07-04-2013 at 11:51 PM.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    your seperation leaves a blank space in middle name

    either trim the vlookup or trim in your formula in seperating or adjust the position one space
    Last edited by humdingaling; 07-05-2013 at 12:01 AM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    apart from "your seperation leaves a blank space in middle name" this is my vlookup formula fine


    I have tested the trim formula as well but it is not working could you please provide more suggestions

    =TRIM(VLOOKUP($D2,Data1!$E$2:$G$36,2,FALSE))

    also I tested VLOOKUP($D2,Data1!$E$2:$G$36,2,FALSE)

    =trim(G2) which is the result VLOOKUP($D2,Data1!$E$2:$G$36,2,FALSE)


    Can you provide me the formula so I can test it on it. See attached spreadsheet for more infomation.

    Thanky you
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    sorry should of explained better what i meant to trim
    Column D has extra " " in there, you can test just by pressing f2 in any cell in column D ....most noticable in the empty cells
    you need to trim that before doing vlookup
    ie F2 = trim (D2)
    and vlookup against f2

    or
    trim in the formula
    =VLOOKUP(TRIM($D2),Data1!$A$2:$C$36,2,FALSE)

    or what you are doing the left mid right bit...somewhere in it your added an extra space
    cant comment on that because you havent posted the formulas

  5. #5
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    Thanks mate, I got it now. Trim function is working now and gives me some result now This is the formula I was using to extract middle name from full name, I wasn't using trim function so there was extra space comingat the end of the name so I trim it n it working now

    =TRIM(CONCATENATE(IF(ISERR(MID($A28,FIND(" ",$A28)+1,IF(ISERR(FIND(" ",$A28,FIND(" ",$A28)+1)),FIND(" ",$A28),FIND(" ",$A28,FIND(" ",$A28)+1))-FIND(" ",$A28)-1)),"",MID($A28,FIND(" ",$A28)+1,IF(ISERR(FIND(" ",$A28,FIND(" ",$A28)+1)),FIND(" ",$A28),FIND(" ",$A28,FIND(" ",$A28)+1))-FIND(" ",$A28)-1)), " ",(IF(ISERR(MID($I28,FIND(" ",$I28)+1,IF(ISERR(FIND(" ",$I28,FIND(" ",$I28)+1)),FIND(" ",$I28),FIND(" ",$I28,FIND(" ",$I28)+1))-FIND(" ",$I28)-1)),"",MID($I28,FIND(" ",$I28)+1,IF(ISERR(FIND(" ",$I28,FIND(" ",$I28)+1)),FIND(" ",$I28),FIND(" ",$I28,FIND(" ",$I28)+1))-FIND(" ",$I28)-1)))))


    But still there is a problem of employees either having same first name or same last name or same middle name.

    so far my vlookup formula is running on middle name and looking in the range of first name, middle name and last name it is still not able to recognise the correct result

    because two people have different last name n first name but same middle name. So it is difficult to trust the results.

    Is there a way to tie up ur vlookup formula to look up middle name in the lookup range and check there corresponding first name & last name match it then give me the result as middle name to the correct first name n last name.

  6. #6
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    How to match middle name from one set of data to first name & last name of other set of data and check if there middle name is same and matching first name & last name too then provide there middle name as a outcome.

    How it will possible using vlookup or any other function available in excel


    Thank you

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    so what your saying
    if you find a middle name, look up first name and surname as well?

    hmmm i looked at both tables
    there is no overlap is that by design?
    Last edited by humdingaling; 07-05-2013 at 01:10 AM.

  8. #8
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    Yes you are right if you find a middle name, lookup first name and surname as well and returns the corresponding matching middle name.

    What do you meant by design? Do you mean the names yes if yes it is by design.

    Also, I have attached the updated spreadhseet for your reference.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    there is no overlap in the two tables so they are all N/A
    did you do that on purpose is what i meant

    because you really cant check if something works if they all give you N/A response

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    still not 100% on what you are trying to do or achieve

    added some data to achieve something
    does this work?
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    What I want to achieve is this for EG

    Data set 1
    First Name Mid Name Last Name
    Peter Ruse Parker
    Chris Dave Mackay
    Robert Ruse Stent


    Data set 2

    First Name Mid Name Last Name
    Chris Dave Mackay
    Peter R Parker
    Robert Ruse Stent


    Now when you do a vlookup based on my spreadsheet on data 1 to lookup mid name in data2 it gives me a result below

    Mid Name(result) Data set 2 First name last name
    Ruse Chris Mackay
    R Robert Stent


    The above result is wrong as per my data Robert stent has prpoer mid name as Ruse in both data sets where as Peter Parker doesn't and in this result there is nothing for Peter Parker so if I have 100 of line of rows of data then it is hard to trust the accuracy and result of the formula

    What I want is simply show me

    Mid Name(result) First name last name
    Dave Chris Mackay
    Ruse Robert Stent
    #N/A Peter Parker

    so that I know peter mid name doesn't match and then i can filter the result and update our records.

    This is possible or am I looking for something that is out of the box.

    Thanks

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    ok i typed in your scenario

    does this do what you want? or am i oversimplying it?
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    07-02-2013
    Location
    melbourne
    MS-Off Ver
    Excel 2010
    Posts
    10

    Post Re: Vlookup or any other function to find, match and provide exact middle name from data

    Yes it works fine. I have made couple of changes to your formula by removing some spaces, and expanding lookup range to get mid name as result. The result showing #N/A means no matching record found is that right? so that I can filter on it and update the records.

    Please check the attached spreadsheet with change formula.

    Thanks for your help and support, much appreciated.
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup or any other function to find, match and provide exact middle name from data

    not a problem
    glad to help

    Dont forget to mark solved if you do not require any more help on this problem

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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