+ Reply to Thread
Results 1 to 10 of 10

Condensing multiple rows into 1

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    houston
    MS-Off Ver
    Excel 2013
    Posts
    4

    Condensing multiple rows into 1

    I have a list of bars and sales per month. Months are the column headers and looks like this:

    Bar Jan Feb March May

    Cliff's 4,000
    Cliff's 3,000
    Cliff's 5,000
    Cliff's 4,000
    Joe's 2,500
    Joe's 5,000
    Joe's 3,000
    Mike's 5,000
    Mike's 6,000
    Mike's 5,000
    Mike's 5,000

    But I'd like it to look like this

    Bar Jan Feb March May

    Cliff's 4k 5k 3k 4k
    Joe's 3k 5k 2.5k
    Mike's 5k 5k 6K 5k


    Notice how Joe's is missing Jan, that's because not all bars report every month sometimes they skip a month and report double the next month, which is why this is giving me so much trouble. Any thoughts are appreciated and I've gone over the pivot table option 100 times and can not make that work.

    Also the list contains 175,643 entries and 15,421 unique bar names and I'm going back 12 months. Please help.

  2. #2
    Registered User
    Join Date
    07-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/2010
    Posts
    86

    Re: Condensing multiple rows into 1

    This code will just combine consecutive names together. not sure if this is what u want.
    Please Login or Register  to view this content.
    Boon

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,959

    Re: Condensing multiple rows into 1

    Hi and welcome to the forum

    If you take a look at your post, you will see that "Notice how Joe's is missing Jan" isnt obvious. Copy/paste often doesnt show up too well in here

    Having said that, if you already have the unique names in a table (or at least in the start of a table), then you can use something like this, copied down and across...
    =SUMIF($A$2:$A$12,$A16,B$2:B$12)
    You dont need VBA for this

    If you dont already have a list of unique names, copy ALL names to where you want the table to be and use Data/Data Tools/Remove duplicates to give you that list
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    06-04-2013
    Location
    houston
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Condensing multiple rows into 1

    Wow that did not show up at all the way it had been intended to. Everytime I hit reply it drops all formatting so I took a pic of what it looks like to what I would like it to look like.

    Capture.JPG

    In the mean time I'll test your solutions, Thanks.
    Last edited by Shido151; 06-05-2013 at 08:19 AM.

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/2010
    Posts
    86

    Re: Condensing multiple rows into 1

    FDibbins's way should work the way u want it to be

  6. #6
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Condensing multiple rows into 1

    at A15 (array formula)
    {=IFERROR(INDEX($A$2:$A$12,MATCH(,COUNTIF(A$14:A14,$A$2:$A$12),0)),"")}

    drag it down

    at B15
    =IF($A15="","",SUMIF($A$2:$A$12,$A15,B$2:B$12))

    drag it right and down

  7. #7
    Registered User
    Join Date
    06-05-2013
    Location
    Moscow, Russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Condensing multiple rows into 1

    Another variant, without formulas or VBA macro. Pivot Table only (see Attached File)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-28-2012
    Location
    Belarus
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Condensing multiple rows into 1

    Quote Originally Posted by Shido151 View Post
    Any thoughts are appreciated and I've gone over the pivot table option 100 times and can not make that work.
    Also the list contains 175,643 entries and 15,421 unique bar names and I'm going back 12 months. Please help.
    You can solve your task with a simple Pivot Table, no code is required. Please see the sample attached.
    Shido151-928598-example.xlsx

    If this is what you are looking for, please let me know and I'll explain in detail how to create it.

  9. #9
    Registered User
    Join Date
    06-05-2013
    Location
    Moscow, Russia
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Condensing multiple rows into 1

    Alexander Frolov, you saw my file? Your decision differs nothing from mine

  10. #10
    Registered User
    Join Date
    01-28-2012
    Location
    Belarus
    MS-Off Ver
    Excel 2013
    Posts
    12

    Re: Condensing multiple rows into 1

    Quote Originally Posted by Serge 007 View Post
    Alexander Frolov, you saw my file? Your decision differs nothing from mine
    Oops, sorry, I overlooked this

+ 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