+ Reply to Thread
Results 1 to 3 of 3

Excel Macro Group By then SUM

  1. #1
    Registered User
    Join Date
    02-22-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    3

    Excel Macro Group By then SUM

    Hi, I need help to create macro with GROUP BY and SUM for below spreedshhet..

    DATA IN Sheet_1

    ID Date Price
    0001456 3/01/2008 $1,23.96
    0001456 3/01/2008 $651.47
    0001456 3/01/2008 $731.46
    0001457 3/01/2008 $55.00
    0001457 3/01/2008 $6.00
    0001458 3/01/2008 $43.92
    0001458 3/01/2008 $1,892.45
    0001458 3/01/2008 $6,852.33
    0001459 3/01/2008 $7,098.00
    0001459 3/01/2008 $8,408.10
    00014510 4/01/2008 $9,766.10
    00014511 4/01/2008 $780.64
    00014511 4/01/2008 $7,251.62

    Output Result I am looking for in Sheet_2:

    ID Date Price
    0001456 3/01/2008 $1,382.93
    0001457 3/01/2008 $61.00
    0001458 3/01/2008 $8,788.70
    0001459 3/01/2008 $15,506.10
    00014510 4/01/2008 $9,766.10
    00014511 4/01/2008 $8,032.26

    Condition is if ID and DATE (group by) are queals then SUM of price?

    Any idea? It’s urgant. Thank You.
    Last edited by VBA Noob; 02-23-2009 at 05:07 AM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Excel Macro Group By then SUM help...urgent

    Hi su[erdec, and welcome to the forum.

    My best suggestion would be to use a Pivot Table. It will do exactly what you need, as shown in the attached example file. Original data is on Sheet1, with the Pivot Table on Sheet2.

    Hopefully that works for you.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-22-2009
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel Macro Group By then SUM help...urgent

    Any other way to create macro (not using PivotTable). Also I need Macro to delete BLANK ROWS in entire spredsheet??

+ 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