+ Reply to Thread
Results 1 to 2 of 2

Calculate totals from a date range

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2021
    Posts
    974

    Calculate totals from a date range

    I was hoping someone would be able to help with some vba coding which would allow the following:
    In my "Journal" worksheet I need the code to identify all similar dates in column "A" and then sum all calories listed affiliated with those similar dates (Column "D") and then place the date and calorie totals in the "Day Summary" sheet Column's A & B. I'll need the coding to allow for a history of dates and affiliated totals to remain so the coding will then identify Monthly totals too in Day Summary sheet column "E".
    Any help would be greatly appreciated. (See attached sample workbook)
    Attached Files Attached Files
    Last edited by lilsnoop; 03-04-2012 at 05:47 PM.

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

    Re: Help with vba code to calculate totals from a date range

    Hi lilsnoop,

    You don't need VBA for this, you can just use a Pivot Table. Select your table on the journal tab and click Insert > PivotTable. Drag the Date field to the Row Headers section, and the Calories field to the Values area. That will give you a sum of calories by day. To see by month you can create a second pivottable the same way, then right-click on the date field and group by month.

+ 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