+ Reply to Thread
Results 1 to 9 of 9

Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

  1. #1
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    I have a sheet listing tasks in google sheets. Whenever a task is completed, the datestamp is logged in the row from column H onwards.
    If a task is not completed in an interval shorter that the set period, then it has missed it's deadline.
    I each task has a set interval for how regularly it should be completed. I want to be able to count how long a streak a given task has kept to the schedule.

    Here is example data with the streak filled in manually
    Period Streak Days Since 45,103 (logged date stamps)
    Task1 14 5 1 45,102 45089 45076 45063 45050 45037
    Task2 180 2 6 45,097 44935 44773 44548 44323 44098
    Task3 7 3 0 45,103 45097 45091 45085 45076 45067
    Task4 14 2 0 45,103 45090 45077 45060 45043 45026

    Example sheet here https://docs.google.com/spreadsheets...gid=2100307022

    So I need a formula that will count along the row, finding the length between pairs of date stamps, and counting how many periods have passed before a deadline was missed.
    I have no idea how to set this one up. Any help would be greatly appreciated.

    I have also added an excel file with the example data.

    EDIT: I found my own solution (where timestamp logs start in column H)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by truk2; 07-03-2023 at 10:24 PM. Reason: Adding Solution
    If my solution helped, please consider adding Rep

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    Since solutions in Google Sheets will not necessarily work in XLSX files, please share a Sheets file.

    To share a file anonymously, you use this form to create a Sheets file into which you can build your sample:

    https://docs.google.com/forms/d/e/1F...VbWiA/viewform
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  3. #3
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    Thanks for sharing how to do that. This is my first time posting a Google Sheets question.

    Here is my example sheet.
    https://docs.google.com/spreadsheets...gid=2100307022

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    The following formula produces the same results as those shown in column C of the .xlsx file attached to post #1 and I believe that it will work in sheets.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    Thanks JeteMc.
    Unfortunately that doesn't actually work.
    Your formula works only if the range is of the specific size. If the data size is larger, your formula undercounts. If the data size is smaller, your formula counts blanks as a streak.
    Perhaps I should have made my example more messy.

    The thing I'm trying to do is to count a streak as more time stamps are logged/inserted into the row. So I don't necessarily know how many timestamps there are. This means that there many be a long series to count, or there may be only a few followed by blanks.
    I've adjusted the shared google sheet to make the problem clearer.
    Last edited by truk2; 06-27-2023 at 01:53 PM.

  6. #6
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    I managed to work out a solution.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    Hi truk2,

    In case you're interested, here is an array formula you can just enter it into one cell in row 2 (no need to drag it down):

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    Quote Originally Posted by janmorris View Post
    Hi truk2,

    In case you're interested, here is an array formula you can just enter it into one cell in row 2 (no need to drag it down):
    Thanks. I love getting additional takes, and improving my use of LAMBDA.
    This solution does work, but it fails if the rows get sorted and the formula cell gets moved down the page. I do want to sort the data regularly, so I won't use this here, but saving the example.
    Thanks again

  9. #9
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Formula to Count Interval 'Streak' in Date Stamps (Google Sheets)

    "This solution does work, but it fails if the rows get sorted and the formula cell gets moved down the page"
    That can be solved by dropping it into the header cell with the header added into the array:

    Please Login or Register  to view this content.

+ 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. Help with a formula to count specific cells, while excluding certain text - Google Sheets
    By needhelpwithexcelplz in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 12-18-2022, 01:37 AM
  2. Google SHeets: Count Checked checkboxes in filtered data of google sheet
    By Faizan Naseem in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 07-07-2022, 05:42 AM
  3. dynamic formula to count through existing and new sheets(In google sheets)
    By wlinksanju in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 11-26-2020, 09:16 PM
  4. Google Sheets: need to dynamic formula for unique value and count multiple same value
    By wlinksanju in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 11-21-2020, 10:29 PM
  5. [SOLVED] IF Formula To Determine Utilization Count Based On Date & Time Stamps
    By Gtrtim112 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-08-2020, 09:36 AM
  6. Google Sheets: Calculate longest winning streak
    By yonifx in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 17
    Last Post: 12-28-2017, 01:43 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