+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Combine data from multiple rows into one column when other column data changes

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    2

    Combine data from multiple rows into one column when other column data changes

    Hi,

    New to forum and hoping there is an answer to my quest

    I have a sizable spreadsheet of customers and their contract numbers. Many customers have more than one contract. Each contract is on a separate row with the customer's information being repeated for each row.

    The attached example shows one set of data in it's existing form with one row of customer information for each contract they own, whether it is one contract or more.

    The next set of data on the same attachment shows what I would like to be my resulting data. That being, each customer having one row of data and their contract number or numbers in one cell of the customer's row of information. Multiple contract numbers would be separated with a comma and space.

    The information will eventually be used in a Word mail merge to send one letter to each customer and list their contract number or numbers on their letter.

    Any help would be greatly appreciated! I am a very good but basic-level Excel user.

    Kerri
    Attached Files Attached Files
    Last edited by Kerri; 06-08-2012 at 03:15 PM. Reason: solved

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094

    Re: Combine data from multiple rows into one column when other column data changes

    Hi,

    You can download an add in called Morefunc and use the MCONCAT function from that to do what you want. Once you download try,

    =MCONCAT(OFFSET($A$2,MATCH(I3&J3,$A$3:$A$11&$B$3:$B$11,0),5,COUNTIFS($A$3:$A$11,I3,$B$3:$B$11,J3),1),", ") in N3. This is an array formula so it needs to be commited with the key combination of Ctrl+Shift+Enter. Then drag down as needed.

    The download is available here: http://download.cnet.com/Morefunc/30...N_0gqcgOfrNf4A

    HTH
    Steve

  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 from multiple rows into one column when other column data changes

    This should do it pretty quickly:

    Please Login or Register  to view this content.


    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook

    The macro is installed and ready to use. Press Alt-F8 and select MergeRows from the macro list.
    _________________
    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!)

  4. #4
    Registered User
    Join Date
    06-08-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Combine data from multiple rows into one column when other column data changes

    Thank you both! I tried SteveG's resolution and it worked perfect. Kerri

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Combine data from multiple rows into one column when other column data changes

    Hi Kerri,

    This "quickie" works to your specs:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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