+ Reply to Thread
Results 1 to 4 of 4

Combine data sheet

  1. #1
    Registered User
    Join Date
    01-06-2009
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    57

    Combine data sheet

    Hi, i have few data sheets with one primary key. I wish to combine these data sheets into one sheet based on the primary key. For example,
    Sheet 1
    ID Msg1 Msg2 Msg3
    A001 ABC XYT UYT
    A001 ABC UYU JJU
    A002 RTU UYU JJU

    Sheet 2
    ID Source
    A001 Annie
    A001 Penny
    A002 Raymond

    Output
    ID Msg1 Msg2 Msg3 Source
    A001 ABC XYT UYT Annie
    A001 ABC XYT UYT Penny
    A001 ABC UYU JJU Annie
    A001 ABC UYU JJU Penny
    A002 RTU UYU JJU Raymond

    I hope anyone can help. Thanks in advance

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combine data sheet

    Straight INDEX/MATCH formula. Assuming you're pulling that data onto Sheet1 in column E, in the E2 put this formula and copy down:

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

    ...and copy down.

    (No, this won't work...will require VBA to do this simply)
    Last edited by JBeaucaire; 03-11-2009 at 03:21 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combine data sheet

    Doh! You said "primary key" so I falsely assumed (didn't look close enough) that column was UNIQUE. I see in your example it is not. Is there any UNIQUE correlating key at all or is this all duplicated like in your example?

  4. #4
    Registered User
    Join Date
    01-06-2009
    Location
    KL, Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    57

    Re: Combine data sheet

    Sorry, may be my explanation confuse you. Please look at the sample file.

    Thanks
    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