+ Reply to Thread
Results 1 to 5 of 5

Match ID# and Return adjacent data

  1. #1
    Registered User
    Join Date
    10-29-2010
    Location
    MN
    MS-Off Ver
    Excel 2003
    Posts
    10

    Match ID# and Return adjacent data

    I have a large list of ID#'s with corresponding data. See attahced mock up.

    I've tried messing around with some if, match/index and vlookup functions, but nothing seems to come close to what I'm looking for on their own.

    What I want to do is if the ID# in Col. "C" matches another ID in the same column, to return the relationship status from "A" and name from "B" into "D"

    So for row 1 it should return: "Self JIM, Spouse Elizabeth, Child Child1, Child Child6, Child Child11"

    Thank you for any and all hints, tips and tricks!
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Match ID# and Return adjacent data

    Hi,

    Why not use a pivot table approach - see attached. You can hide column I which for this purpose does not need to be visible although it's necessary to get the PT grouping.

    HTH
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Match ID# and Return adjacent data

    The attached is somewhat crude but works. It does not, however, recognize that, when you go to a row like "Elizabeth" that she is now the "Self", not the "Spouse"; her spouse is, in fact, Jim. That gets way complicated.

    I'm sure someone will come up with a more elegant solution, but mine is at least quick if not dirty.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-29-2010
    Location
    MN
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Match ID# and Return adjacent data

    Close, I have not worked with Pivot tables much yet. But this is on the right track it looks like. I need the data to come out in a single row however. Once this is formatted we'll be using a mail merge in publisher that requires all the data for one record (Self, Spouse and Child) to be in one row.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Match ID# and Return adjacent data

    OK, try the following variation.

    It uses the pivot table as a start, and then a macro takes the PT data and transposes it into the layout you want. Click the button to produce the list.

    The macro used is:

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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