+ Reply to Thread
Results 1 to 4 of 4

Combine multiple ALMOST duplicate rows into a single row

  1. #1
    Registered User
    Join Date
    05-19-2009
    Location
    WA, USA
    MS-Off Ver
    Excel 2010 and Office 365
    Posts
    50

    Combine multiple ALMOST duplicate rows into a single row

    Well, once again there is probably an easy solution to my problem, but I've searched alot of different sites and nothing seems to be what I need.

    Again, at work we use Excel 2010. Another program exports an Excel file in the following format where a range of rows may contain all of the same date EXCEPT for the last column, as shown below.

    UPC Brand Description Size Auth'd Stores
    85191600300 COOLHAUS CHOC/VB IC SANDWCH 5.2 FZ 53
    85191600300 COOLHAUS CHOC/VB IC SANDWCH 5.2 FZ 55, 61
    85191600300 COOLHAUS CHOC/VB IC SANDWCH 5.2 FZ 17, 71, 79
    85191600303 COOLHAUS CHC BCN IC SANDWCH 5.2 FZ 53
    85191600303 COOLHAUS CHC BCN IC SANDWCH 5.2 FZ 71

    As you can see, the first three rows are the same item, and the last two rows are another item. The only difference in those two groups is the "auth'd stores".

    What I need to ask your help with is getting that down to just two single lines, as below.

    UPC Brand Description Size Auth'd Stores
    85191600300 COOLHAUS CHOC/VB IC SANDWCH 5.2 FZ 53, 55, 61, 17, 71, 79
    85191600303 COOLHAUS CHC BCN IC SANDWCH 5.2 FZ 53, 71

    Whether the "auth'd stores" are listed numerically or not isn't really important if it's too involved. I've got a "sortcell" macro I can use for that if I need to.

    Thank you again, in advance, if you can help. I hate asking for these things, but I really can't figure out how to do this.

  2. #2
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Combine multiple ALMOST duplicate rows into a single row

    One way: (With values in A2:E6)
    F2: =IF(A2&B2&C2=A1&B1&C1,F1&", "&E2,E2)
    (copy down)
    This will add value from each row to values from previous rows with same Item.

    G2: =IF(A2&B2&C2=A3&B3&C3,0,1)
    (copy down)
    This identifies last row for each item (which has the correct value in column F) and gives the value 1.

    Last steps is to [Copy/paste as values] column F and G and deleting rows with value 0 in column G using filter function.

  3. #3
    Registered User
    Join Date
    05-19-2009
    Location
    WA, USA
    MS-Off Ver
    Excel 2010 and Office 365
    Posts
    50

    Re: Combine multiple ALMOST duplicate rows into a single row

    Thanks, estige!!!!

    Once again, you guys here are awesome!!!!

    The only things I changed was A2&B2&C2=A1&B1&C1 to A2=A1 in the first part, and from A2&B2&C2=A3&B3&C3 to A2=A3 in the second part. All of the other columns will always be the same for one UPC. The only thing that would possibly be different is the last column.

    Worked like a charm. Easy to understand.

    Thank you again. (Bumped your rep, too.)

  4. #4
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Combine multiple ALMOST duplicate rows into a single row

    Thank you for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 02-19-2014, 10:25 AM
  2. Combine and Sum data in multiple rows if duplicate exists in 1 column
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 07:11 PM
  3. [SOLVED] Combine duplicate rows into a single row in Excel
    By jkshaver in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-20-2012, 10:49 PM
  4. Combine multiple rows into a single row with concatenation
    By MichaelWood in forum Excel General
    Replies: 7
    Last Post: 06-30-2012, 01:49 PM
  5. Replies: 8
    Last Post: 04-12-2012, 08:02 PM

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