+ Reply to Thread
Results 1 to 16 of 16

Link Spreadsheets - Merge Data

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2006
    Posts
    27

    Question Link Spreadsheets - Merge Data

    I have two spreadsheets with similar data (Last Name, First Name, User ID). One spreadsheet has the two name fields separated into two columns, while the other has them combined into one (Lastname, Firstname). The first spreadsheet doesn't have the UserID field populated. I need to compare the records between the two spreadsheets and update the UserID from SS2 to SS1 where a match is found.
    • How do I link the two spreadsheets?
    • How do I perform the comparison between the first and last name fields, being that they are record in two columns in SS1 and a single column in SS2?
    • When a match is found between spreadsheets, how do I copy the UserID from SS2 to SS1?

    I have not scripted Excel before, so this is a totally foreign task for me. Thanks.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Take a look at the Vlookup() function in Help ...F1
    It should fix your problem ...

    HTH
    Carim

  3. #3
    Registered User
    Join Date
    11-06-2006
    Posts
    27
    This looks like a great place to start, if I can figure out how to perform it between two different spreadsheets. However, it doesn't clear the hurdle of comparing names found in one column in SS2 and two columns in SS1.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this.

    http://cjoint.com/?lgvq5hevBS

    Had to add a new column to sheet two which you can hide to join the first name and last name for the search

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    11-06-2006
    Posts
    27
    Thanks. I was acutally toying with combining the two column into one, and then doing a comparison: =CONCATENATE(A1,", ",B1).

    I think I may need to copy the worksheet of SS2 into SS1 so I can do the VLOOKUP.

    In my formula, can I combine functions to have the conatenation and the VLOOKUP in the same string?

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    I used this to change the Last name, First Name into First Name Last Name e.g Jones, Jack to Jack Jones.

    =VLOOKUP(TRIM(RIGHT(A2,LEN(A2)-FIND(" ",A2))&" "&LEFT(A2,FIND(" ",A2)-2)),Sheet2!A1:D3,4,0)

    So looks like you want to look up last name first name (Seperate Columns) to Last Name, First Name column. Then try this

    =VLOOKUP(TRIM(A2&", "&B2),Sheet1!A1:B3,2,0)

    A2 = Last Name
    B2 = First Name
    &", "& inserts space and a comma


    VBA Noob

+ 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