+ Reply to Thread
Results 1 to 6 of 6

Sum duplicates values and remove rows

  1. #1
    Registered User
    Join Date
    09-15-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Sum duplicates values and remove rows

    Hi
    I have a data in two columns, A and B. Column A contains the price and column B contains how many products with that price I have sold.
    Ex:

    1050 2
    950 1
    950 1
    950 1
    1200 2
    800 2
    800 1
    3200 1
    1000 1
    1000 2

    Can you please write a macro that adds the sum of the duplicate prices and adds the number of products that I have sold with that price and removes the duplicates?
    The result should look like this
    1050 2
    2850 3
    1200 2
    1600 3
    3200 1
    2000 3

    Thank you

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sum duplicates values and remove rows

    We may assume data is starting from row 1 ...!
    Last edited by PCI; 04-28-2016 at 04:55 AM. Reason: Typo
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    09-15-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum duplicates values and remove rows

    Yes you can!

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Sum duplicates values and remove rows

    Try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-15-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum duplicates values and remove rows

    Thanks a lot! I will try the code as soon as I get home.

  6. #6
    Registered User
    Join Date
    09-15-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum duplicates values and remove rows

    The code works like a charm. Thanks a lot!

+ 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. How to remove rows that are NOT duplicates
    By ecruz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2015, 04:51 PM
  2. How to remove duplicates AND values that have duplicates?
    By bachfantasia in forum Excel General
    Replies: 9
    Last Post: 05-13-2014, 07:05 PM
  3. [SOLVED] Find duplicates rows, sum cells then remove duplcate rows
    By Wagstaff in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-22-2013, 09:37 AM
  4. Remove rows without Duplicates
    By Apple1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-28-2013, 10:12 AM
  5. Replies: 1
    Last Post: 10-23-2012, 09:12 AM
  6. Macro to remove duplicates values and keep unique values bases on multiple criteria
    By Ricker090 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2011, 04:37 PM
  7. Remove row duplicates depending on values from other rows
    By soli004 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-22-2011, 06:09 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