+ Reply to Thread
Results 1 to 5 of 5

Replacing multiple values with multiple values

  1. #1
    Registered User
    Join Date
    05-13-2011
    Location
    Nashville
    MS-Off Ver
    Excel 2007
    Posts
    2

    Replacing multiple values with multiple values

    I need to do a complicated version of find & replace involving two spreadsheets. The first spreadsheet has 2 columns with multiple instances of employee names and numbers:
    # Name
    1 John Doe
    2 Jane Smith
    2 Jane Smith
    2 Jane Smith
    3 Joe Blow
    3 Joe Blow

    The second spreadsheet has only single instances of employee names and CORRECT numbers:
    # Name
    123 John Doe
    456 Jane Smith
    789 Joe Blow

    What I need to do is replace the "#" column in the first spreadsheet, with the correct numbers from the "#" column in the second spreadsheet, so it would end up like this:
    # Name
    123 John Doe
    456 Jane Smith
    456 Jane Smith
    456 Jane Smith
    789 Joe Blow
    789 Joe Blow

    There are over a thousand employees so hoping to not have to do this by hand. Any ideas?

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

    Re: Replacing multiple values with multiple values

    In a 3rd column, you can use a Index/Match lookup to get correct ID.

    e.g.

    =INDEX('Sheet2'!A:A,MATCH(B2,'Sheet2'!B:B,0))

    where B2 contains first name in sheet1.

    copy formula down.

    Then you can copy this column and paste special >> Values over the original column A, then delete the formula column.
    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 Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Replacing multiple values with multiple values

    You should be able to do it with INDEX() and MATCH().

    Where you have the numbers on sheet 1 (I'll assume it begins at A2) place this formula:

    =INDEX(Sheet2!A:A,MATCH(B2,Sheet2!B:B,0))

    and copy down.

    This assumes numbers and names are in A and B columns of sheet 2.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Replacing multiple values with multiple values

    @NBVC
    I'm going to go out on a limb here and say that you use all fingers to type!!!
    Too darned fast!

  5. #5
    Registered User
    Join Date
    05-13-2011
    Location
    Nashville
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Replacing multiple values with multiple values

    Wow!!! You guys are awesome - I'm off to try it!

+ 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