+ Reply to Thread
Results 1 to 10 of 10

Create a rolling 60 minute window to assess busiest time period

Hybrid View

  1. #1
    Registered User
    Join Date
    03-01-2023
    Location
    London, England
    MS-Off Ver
    Excel for Mac, Excel 16.80, MS365
    Posts
    10

    Create a rolling 60 minute window to assess busiest time period

    Hi there,
    I have a dataset whereby I am trying to determine the busiest 'rolling' 60 minute periods. I can create this by clock hour, or 15, 30 minute periods etc, but I can't find how to achieve it for rolling periods. I know it is easy to do when the period is a standard 'thing' like day, or even hour, but my dataset is down to minute level.
    Please see my data sample attached. I have entries that could vary by a minute, not just every 5 min as shown.Rolling60minsample.xlsx
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Create a rolling 60 minute window to assess busiest time period

    Can try something like this:
    Rolling60minsample - Copy.xlsx
    <<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts

  3. #3
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Create a rolling 60 minute window to assess busiest time period

    Great that it worked for you. Word of caution is just to take care if it rolls over midnight - in which case you can add days into the calculation too. But no need to overcomplicate if not required for your use case.

  4. #4
    Registered User
    Join Date
    03-01-2023
    Location
    London, England
    MS-Off Ver
    Excel for Mac, Excel 16.80, MS365
    Posts
    10

    Re: Create a rolling 60 minute window to assess busiest time period

    Ah, good point. I will be looking at data across the full 24h spectrum so e.g. in column G, if I have a RH Time Start of e.g. 23:50 then that needs to capture data 23:50 to 00:49. I need to extend the formula to encompass this.
    Struggling to work out the syntax at this hour so will look again tomorrow. If you have any quick pointers on how to extend, that would be amazing!

  5. #5
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Create a rolling 60 minute window to assess busiest time period

    Two approaches depending on your needs.

    1) If you want to treat your dataset as being the same each day, then you just add logic so that from 11pm onwards, look at the start of day data again. i.e. for 23:15-00:14, use the existing formula to pick up 23:15-23:59, then add from 00:00-00:14 from the start of your list again.
    Cell H2 becomes:
    Formula: copy to clipboard
    =SUMIFS(B:B,C:C,">="&VALUE(TEXT(G2,"hhmm")), $C:$C, "<"&VALUE(TEXT(G2+1/24,"hhmm"))) + IF(HOUR(G2)=23,SUMIFS(B:B,$C:$C, "<"&VALUE(TEXT(G2+1/24,"hhmm"))))


    2) If it's different data for each day, then you can use the similar approach by combining the date and time and formatting the TimeToVal as
    Formula: copy to clipboard
    =VALUE(TEXT(datetime, "DDHHMM"))
    . You then also need to add days to your rolling hour analysis columns and logic too. Can help tomorrow if you go down this route and need some help

  6. #6
    Registered User
    Join Date
    03-01-2023
    Location
    London, England
    MS-Off Ver
    Excel for Mac, Excel 16.80, MS365
    Posts
    10

    Re: Create a rolling 60 minute window to assess busiest time period

    Many thanks again!

    Option 1 fits the use case perfectly. Saved me so much time figuring out the format.
    Diamond, thank you.

  7. #7
    Registered User
    Join Date
    03-01-2023
    Location
    London, England
    MS-Off Ver
    Excel for Mac, Excel 16.80, MS365
    Posts
    10

    Re: Create a rolling 60 minute window to assess busiest time period

    Hello again, hoping AskMeAboutExcel is on here and able to look at this for me again. Sorry!
    I have an extended version now of my previous issue whereby there are multiple dates as well as times to sort through. So in the previous example, a time series column ahead of the time column, with year-mo-da format. [Edited to add attachment now]
    Can you possibly extend the formula to look at the busiest 60 minute rolling window across the whole time series? I've tried a few versions but not really getting past the formula looking at the hours (mostly) only.Rolling60minsample.xlsx
    Last edited by Notsoeasy; 03-13-2023 at 05:00 PM. Reason: Add attachment

  8. #8
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Create a rolling 60 minute window to assess busiest time period

    not sure if the sequence formula will work with your version of excel - if it does then the first option will be fine, but if not I've hardcoded a v2 that you can replicate

    Depending how big your dataset is, there is a sensible limit to how many days you can study with this approach due to the number of rows involved. If a large number of dates, you might want to try some smarter formula approaches / powerquery

    Rolling60minsample_v2 - Copy.xlsxRolling60minsample_v1 - Copy.xlsx

  9. #9
    Registered User
    Join Date
    03-01-2023
    Location
    London, England
    MS-Off Ver
    Excel for Mac, Excel 16.80, MS365
    Posts
    10

    Re: Create a rolling 60 minute window to assess busiest time period

    Many thanks yet again!

    I did manage to lock up excel the first time round (it did warn me...), I think the Sequence formula is what slowed it all down?
    My list is for a calendar year however I have multiple rows of same date in the raw data which I'm assuming expands the computation. I revised down a look up list to minimise this (365/366 rows for the dates) and this seemed to improve operation.
    Typically I only need to look at a year at a time so this works well, and I've copy pasted for a range of years now so have those values on hand to apply to any future analysis.

    Thank you.

  10. #10
    Valued Forum Contributor
    Join Date
    01-07-2022
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    473

    Re: Create a rolling 60 minute window to assess busiest time period

    For a very large set of dates it's likely that Sequence is the culprit for slowing it down.

    Great that this works for you. An alternative to having 10's of thousands of rows is to have a table with dates along the top, minutes on the bottom - the calculation speed will be similar but it makes it a little more manageable to view.

    Rolling60minsample_v4 - Copy.xlsx

    It's still easy to find the MAX value, but finding the corresponding time through formulas is more complex (although you can manually search for the Max result to see the date/time)

+ 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. converting a minute table to a different time period
    By freak11 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 10:50 AM
  2. rolling time period
    By George Nicholson in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-06-2005, 07:05 AM
  3. rolling time period
    By George Nicholson in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] rolling time period
    By JJC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. rolling time period
    By JJC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. [SOLVED] rolling time period
    By JJC in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. [SOLVED] rolling time period
    By JJC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-09-2005, 05:05 PM

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