+ Reply to Thread
Results 1 to 6 of 6

Scan rows for duplicate column values, then add rows together and delete unused rows.

  1. #1
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    35

    Scan rows for duplicate column values, then add rows together and delete unused rows.

    SampleWS.xlsx

    Here is a sample worksheet. In column H, there will be duplicate values (names) where a customer ordered multiple items in one order OR placed multiple separate orders. I want to add the amounts in column E for all the rows with the same name in Column H then delete the remaining rows for that name.

    For example on "Universal Media Sales" The row would read:

    Oct-01-12 Product G,I,J 4 $xx.xx $66.84 ZZZZZZZZ UniversalMediaSales Universal Media Sales Universal Media Sales

    Thanks again for the help, I've been working on this forever!

  2. #2
    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,933

    Re: Scan rows for duplicate column values, then add rows together and delete unused rows.

    to delete the rows on the fly, you would VBA. however, you can use this to identify the duplicates and sum their values, copied down

    =IF(COUNTIF(H:H,H2)>1,"",SUMIF(H:H,H2,E:E))

    you could then either hide all rows based on that formula that have "no values", or you could copy all of those formulas you just created, then past them to themselves as values...and then delete all rows with nothing in them
    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

  3. #3
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Scan rows for duplicate column values, then add rows together and delete unused rows.

    SampleWS.xlsx

    Not sure I entirely understood what you were saying. Here is what I've got so far...the formulas were copied into column F. The duplicate valued rows haven't added anything.

    Thanks for the help!! Almost there...

  4. #4
    Registered User
    Join Date
    10-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Scan rows for duplicate column values, then add rows together and delete unused rows.

    Anybody have a followup on this??

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Scan rows for duplicate column values, then add rows together and delete unused rows.

    This is the vba equivalent of what FDibbins was suggesting.

    Please Login or Register  to view this content.
    abousetta

    P.S. Remember to test on a copy of your actual data.
    Last edited by abousetta; 11-12-2012 at 08:36 PM. Reason: Corrected code
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Scan rows for duplicate column values, then add rows together and delete unused rows.

    I think the formula you are looking for is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    in F2 and dragged down

    abousetta

+ 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