+ Reply to Thread
Results 1 to 11 of 11

Rolling Total

  1. #1
    Registered User
    Join Date
    08-11-2021
    Location
    Florida
    MS-Off Ver
    Excel 2019
    Posts
    75

    Rolling Total

    How would one take a table with names and hours, then calculate a rolling 30 day total of hours based on name? The Table is extremely dynamic and there are multiple entries of the same name.

    Example:

    Name Date hours

    james x 5
    john x 6
    lisa x 10
    james x 6
    john x 10
    james x 3

    Assuming all dates for this example table are in the last 30 days, james' rolling total would be 14hrs; then if the last entry (3) for james fell outside 30 days, it would then change to 11 hrs
    Last edited by DropAGearN'Disappear; 08-20-2021 at 07:30 AM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,452

    Re: Rolling Total

    Pls attach a sample worksheet with actual date, not "x"
    See "how to attach" on the top of page, yellow banner.
    Quang PT

  3. #3
    Registered User
    Join Date
    08-11-2021
    Location
    Florida
    MS-Off Ver
    Excel 2019
    Posts
    75

    Re: Rolling Total

    The dates should be irrelevant. That is an example to of what a sample table might look like. Here is an actual excel example (I cannot share the actual doc as it is trade secret).
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: Rolling Total

    Here is your formula.

    =SUMIFS(Table1[Hours],Table1[Name],[@Name],Table1[Date (DD-MM-YY)],"<="&$C$16,Table1[Date (DD-MM-YY)],">="&$C$16-30)

    Had some issues with your table however. There were additional spaces in some of the Jack's so they did not match up.

    Larry and Jim were not always capitalized so they did not match up.

    C16 needed to be shown as a date and not text.

    This formula works when those items are applied.

    Attention to details are important in Excel otherwise you do not get the right answers.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    08-11-2021
    Location
    Florida
    MS-Off Ver
    Excel 2019
    Posts
    75

    Re: Rolling Total

    Here is the formula I've adapted:

    =SUMIFS(Table3[Down Time
    (x.x Hours)],Table3[Machine Name],[@[Machine Name]],Table3[Date (DD-MM-YY)],"<="&$I$6,Table3[Date (DD-MM-YY)],">="&$I$6-30)

    For the first name, it picks up only one entry and for the rest it reports 0

    Ive double checked name format

    I also addressed the date (NOW)

    Additionally id like to now have to dedicate a cell to read todays date from
    Last edited by DropAGearN'Disappear; 08-18-2021 at 09:06 AM.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: Rolling Total

    Have you made sure that the names in each location are exactly the same. No spaces before or after the name or capitalization? Now includes the time, so I would try with Today() which is the date and no time.

  7. #7
    Registered User
    Join Date
    08-11-2021
    Location
    Florida
    MS-Off Ver
    Excel 2019
    Posts
    75

    Re: Rolling Total

    Now it just doesnt work, I will keep troubleshooting it

    and is there anyway to not have to have a dedicated cell for time?

    WAIT! Fir some reason if i change the date to not todays date for entry it works!!
    how do I account for this? I was a total hours for today + the last 29?
    Last edited by DropAGearN'Disappear; 08-18-2021 at 02:50 PM.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: Rolling Total

    If you can't use Today() then to put the current date in the cell required you can use this keyboard function Ctl + ; that is hold down the Control Key and the semi-colon key at the same time to generate hardcoded today's date.

    Alternatively, you could write a VBA script to have the cell populated with Today's date upon opening of the workbook.

    Here is an example

    Please Login or Register  to view this content.
    Change the range you wish to populate.
    Last edited by alansidman; 08-18-2021 at 03:10 PM.

  9. #9
    Registered User
    Join Date
    08-11-2021
    Location
    Florida
    MS-Off Ver
    Excel 2019
    Posts
    75

    Re: Rolling Total

    Thank you! I actually took out the equal on the last criteria and it works good. It wasnt including todays date for an odd reason I cant quite figure out yet..... So if i enter todays date manually, then it counts it fine, however when I add a new row via command button (the button code automatically inserts todays date) it wont count it. I have to physically click into that cell and hit enter?

    Here is my button code:
    Please Login or Register  to view this content.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,855

    Re: Rolling Total

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  11. #11
    Registered User
    Join Date
    08-11-2021
    Location
    Florida
    MS-Off Ver
    Excel 2019
    Posts
    75

    Re: Rolling Total

    I will! Do you happen to know how to change the format of this line:

    Please Login or Register  to view this content.
    to custom date (dd-mm-yy)? I believe that will make it work perfectly for me!

+ 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. [SOLVED] Rolling tally with total row
    By Goliath27 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 10-29-2020, 11:53 AM
  2. [SOLVED] 12 month rolling total - Help!
    By Mummabee in forum Excel General
    Replies: 7
    Last Post: 11-25-2016, 10:18 AM
  3. Need Help! Rolling total for Last 7 Days
    By .Marshall in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-18-2014, 03:47 AM
  4. 365 day rolling total
    By Intern13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2011, 09:24 AM
  5. Rolling total again
    By WAGM in forum Excel General
    Replies: 5
    Last Post: 01-11-2011, 08:14 AM
  6. VBA rolling +1 total
    By Rick-O-Shay in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2009, 02:46 PM
  7. [SOLVED] Sum Data in Col B, Add % of Total Col C, Add Rolling % of Total Co
    By SteveC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2006, 08:50 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