+ Reply to Thread
Results 1 to 3 of 3

Vba to sum up rows based on column a & b and delete duplicate rows

  1. #1
    Registered User
    Join Date
    06-20-2015
    Location
    Chennai, India
    MS-Off Ver
    2010
    Posts
    59

    Vba to sum up rows based on column a & b and delete duplicate rows

    Hi All,

    Here is my requirement, i.e. here COL A & B will be the key ORAs combination of these two should be unique. Based on this i need to merge (sum) the rows and sum up COL C D E but need to calculate the percentage diff based on the below formula.. Also one more thing i.e. like COL C to COL F (1 set), i have 39 to 45 more sets, which means need to sum up COL G H I and find the percentage diff using formula for COL J and again sum up COL K L M and find pct diff for COL N, etc.......

    would you please help me on this please.

    COL A COL B COL C COL D COL E COL F
    a b c1 d1 dif1 pctdif1
    disc1 song1234 3 20 -17 =(COL E)/(COL C)*100
    disc2 song78 2 30 -18 =(COL E)/(COL C)*100
    disc1 song54 1 10 -9 =(COL E)/(COL C)*100
    disc3 song4 4 10 -6 =(COL E)/(COL C)*100
    disc4 song0 1 15 -14 =(COL E)/(COL C)*100
    disc2 song78 2 16 -14 =(COL E)/(COL C)*100
    disc1 song1234 0 19 -19 =(COL E)/(COL C)*100
    disc4 song9 1 20 -19 =(COL E)/(COL C)*100
    disc1 song1234 0 10 -10 =(COL E)/(COL C)*100

    Attached an excel sheet with expected result:
    Attached Files Attached Files
    Last edited by kevivu; 02-04-2016 at 07:07 PM.

  2. #2
    Registered User
    Join Date
    06-20-2015
    Location
    Chennai, India
    MS-Off Ver
    2010
    Posts
    59

    Re: Vba to sum up rows based on column a & b and delete duplicate rows

    All,

    Wud you please modify this code to work for my example...

    Please Login or Register  to view this content.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Vba to sum up rows based on column a & b and delete duplicate rows

    Hi kevivu

    This Code is in the attached and appears to do as required on your Sample Data. Make certain you have a Sheet named Sheet2. CTRL + x will fire the Code.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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. highlight duplicate rows and delete based on highest value from column
    By adnan5586 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2015, 02:05 AM
  2. [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
  3. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  4. Delete Duplicate Rows based on All columns
    By king12yan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2010, 02:36 PM
  5. Delete Duplicate Rows Based only 2 columns.
    By ebbo in forum Excel General
    Replies: 2
    Last Post: 02-18-2010, 11:27 AM
  6. Delete duplicate rows based on all columns
    By kiran654 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-30-2010, 08:14 AM
  7. Replies: 5
    Last Post: 05-29-2006, 09:25 AM

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