+ Reply to Thread
Results 1 to 4 of 4

Add values from duplicate rows and delete duplicate

  1. #1
    Registered User
    Join Date
    11-18-2016
    Location
    Copenhagen
    MS-Off Ver
    MS 2016
    Posts
    1

    Add values from duplicate rows and delete duplicate

    I have the below values and I want to create a macro to add the duplicates and delete it.

    Apple=260
    Orange=3
    Banana=246
    Apple=43
    Mango=93
    Banana=4
    Melon=260
    Grape=209

    After I run the macro, i want the result to be in the same column with the data as below

    Apple=303
    Orange=3
    Banana=250
    Mango=93
    Melon=260
    Grape=209

    Please help me on how to do it. Thanks in advance!

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Add values from duplicate rows and delete duplicate

    You probably don't need a macro to do this. Your data is organized so that a pivot table should be able to do what you want.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Add values from duplicate rows and delete duplicate

    Hi
    You can use a formula to do that but a pivot table is (I suppose) the better solution as dflak said.
    Assuming your data in a table Products(Names, Qtys) the formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    where J4 is the name of the product

    See the file with both solution.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-26-2016
    Location
    São Paulo - Brazil
    MS-Off Ver
    2016
    Posts
    48

    Re: Add values from duplicate rows and delete duplicate

    jane204

    One more solution

    Decio
    Attached Files Attached Files

+ 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. Macros to delete entire duplicate row for duplicate values
    By cutelebel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2014, 12:09 PM
  2. [SOLVED] Compare Rows, Delete duplicate values, Sum values but Retain blank rows
    By chancw in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-24-2013, 07:38 AM
  3. [SOLVED] Delete rows based on duplicate cell, but leaving first and last duplicate.
    By LadyNicole in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 05:07 AM
  4. VBA helps needed to Sum duplicate values and delete duplicate rows
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2013, 11:40 PM
  5. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  6. [SOLVED] Sum Duplicate values then delete duplicate rows
    By keekdapolak in forum Excel General
    Replies: 7
    Last Post: 09-20-2012, 02:57 PM
  7. Delete rows with duplicate values
    By Smohrman in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 02-02-2011, 10:17 PM

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