+ Reply to Thread
Results 1 to 10 of 10

Combine and delete duplicate rows...dynamically

  1. #1
    Registered User
    Join Date
    11-10-2010
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Combine and delete duplicate rows...dynamically

    I need some help with this! I have a parts list that can be very long. If the same part shows up in more than one row I want to add the totals and remove the duplicate part number's row. Below is an example of what I want to accomplish...

    I have this...

    P/N.......... Description............... U/M..........Qty
    1234.........rivet..........................ea.............1
    1234.........rivet..........................ea.............4
    345...........washer.....................ea.............12
    65.............nut...........................ea.............4
    3846.........prepreg.....................sf..............24
    3846.........prepreg.....................sf..............12
    64.............primer......................ga.............14

    I need it to look like...

    P/N..........Description................ U/M..........Qty
    1234.........rivet..........................ea.............5
    345...........washer.....................ea.............12
    65.............nut...........................ea.............4
    3846.........prepreg.....................sf.............36
    64.............primer......................ga.............14

    As you can see the part numbers (p/n) 1234 and 3846 now show totals and are not duplicated. This also needs to happen dynamically because this parts list changes all the time. I would like not to have to do a macro for this but if it's the only way then I will. Please help! Thanks!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combine and delete duplicate rows...dynamically

    Hi,

    Use Data Filter Advanced to extract a unique list of P/Ns, then alongside them use VLOOKUP to get the Description and U/M from the original list, and use a SUMIF() function to sum the total Qty.

    Unfortunately and without a macro to do this automatically you're going to have to repeat this process every time.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Combine and delete duplicate rows...dynamically

    crc21,


    Detach/open workbook crc21 - EF752796 - SDG12.xls and run macro CreateReport.
    Attached Files Attached Files
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Registered User
    Join Date
    11-10-2010
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Combine and delete duplicate rows...dynamically

    Richard,
    Your direction lead me down the right path and I ended up getting it to work dynamically. Thanks again.

    Stanley,
    I'll try that macro to just to see how it works. Thanks


  5. #5
    Registered User
    Join Date
    06-06-2013
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Combine and delete duplicate rows...dynamically

    Stanley,

    Thank you! Your Macro was exactly what I have been looking for.

    Tammy

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Combine and delete duplicate rows...dynamically

    tmsblevis,

    You are very welcome. Glad I could help.

    Thanks for the feedback.

    And, come back anytime.

  7. #7
    Registered User
    Join Date
    06-06-2013
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Combine and delete duplicate rows...dynamically

    Stan,

    Ok, I've hit a snag. The report I want to apply the macro to is separated by Market (row with just the market designator in column A). If I take out the separation and run the macro, it works great. If I run the report as intended, it "breaks".

    I'm attempting to attach two files: Ops per Location is the format I am suppose to provide and Ops per Location Simple is the one I ran the macro on and worked.

    Any suggestions on what I am doing wrong or what I can do differently?

    Thank you SO much!

    Tammy
    Ops per Location Simple2.xls
    Ops per Location.xls

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Combine and delete duplicate rows...dynamically

    tmsblevis,

    Please do not post your questions in threads started by others - - this is known as thread hijacking.

    Because your new raw data is different from crc21's original request, I would suggest:

    That you start your own New Post with an appropriate title, and, with detailed instructions.

    And, that you attach your workbook with the raw data on one worksheet, and, on another worksheet (manually formatted by you) the results you are looking for.

    Then send me a Private Message with a link to your New Post, and, I will have a look.

  9. #9
    Registered User
    Join Date
    06-06-2013
    Location
    Fremont, CA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Combine and delete duplicate rows...dynamically

    I am SO sorry! I have never used forums before and wasn't aware of the etiquette - I'll start a new thread. My appologies for the inadvertent hijacking.

    Tammy

  10. #10
    Registered User
    Join Date
    04-01-2014
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Combine and delete duplicate rows...dynamically

    Can't download the example.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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