+ Reply to Thread
Results 1 to 8 of 8

Consecutive Worked Shifts in a Period

  1. #1
    Registered User
    Join Date
    05-30-2019
    Location
    Perth
    MS-Off Ver
    OFFICE 2016 DESKTOP
    Posts
    5

    Consecutive Worked Shifts in a Period

    Hi All

    Back Again with another request

    I am chasing a formula that looks back from TODAY() and counts consecutive working shifts within the previous 4 weeks (28 days)

    Working shifts are designated as D and N

    Where any value/text other than D or N is encountered then the 'count' stops

    I have attached a dummy roster sheet with example

    Roster Consecutive Shifts Example.xlsx

    Any help appreciated

    Ta

    Pete
    Last edited by PTruscott; 05-30-2019 at 08:30 PM.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Consecutive Worked Shifts in a Period

    I haven't been able to come up with a shorter/simpler way. Sorry

    Try array entering this beast. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It returns 14 for TODAY() (5/30/2019). I believe that's correct. Doing it manually reveals the same.
    Dave

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Consecutive Worked Shifts in a Period

    Forgot to mention today's date is in D6.

  4. #4
    Registered User
    Join Date
    05-30-2019
    Location
    Perth
    MS-Off Ver
    OFFICE 2016 DESKTOP
    Posts
    5

    Re: Consecutive Worked Shifts in a Period

    Hi Dave

    Thanks for that beast of a formula. I placed it in and it calculates as suggested. However on reflection I may not have explained the request properly.

    I only want to count consecutive shifts from TODAY() back. Not consecutive shifts within the 28 day period. Does that make sense?

    So if TODAY() is a D or N day it counts back consecutive D or N from today's date until it hits a non D or N value within the 4 week period. If TODAY() is a non D or N day then it shows 0

    The policy I am trying to monitor against is per below for fatigue Management

    • The number of consecutive days worked in a 4 week cycle will not exceed 21 days;

    Thanks heaps

    Pete

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Consecutive Worked Shifts in a Period

    If I understand correctly now please try changing SUM to MAX and array enter that. With today's date 6/2/2019 this returns 14.

    Or am I still missing it?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Consecutive Worked Shifts in a Period

    This is a lot shorter. Still array entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-30-2019
    Location
    Perth
    MS-Off Ver
    OFFICE 2016 DESKTOP
    Posts
    5

    Re: Consecutive Worked Shifts in a Period

    Hi Flame

    Thanks heaps fro those emails and formulas.

    I think we are still on slightly different paths

    I have attached an updated spread sheet with your 3 x formulas and 2 x examples with manual calculated answers

    Attachment 626909

    What I am chasing is formula to give answers

    I hope that makes sense

    Thanks heaps

    Pete

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

    Re: Consecutive Worked Shifts in a Period

    Attempting to open attachment 626909 (post #7) results in the following message: "Invalid Attachment specified. If you followed a valid link, please notify the administrator"
    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.

+ 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. Replies: 8
    Last Post: 03-24-2016, 08:13 PM
  2. Dividing time worked on a project over different shifts.
    By lhaskell2000 in forum Excel General
    Replies: 3
    Last Post: 09-15-2015, 02:24 AM
  3. Hours worked on Different Shifts - Breakdown on overtime and ordinary
    By Rangedale in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2015, 12:50 AM
  4. [SOLVED] Calculating total shifts worked across weekly sheets.
    By JonJB in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-01-2015, 11:55 AM
  5. counting consecutive working shifts
    By tvt0290 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-20-2013, 05:10 PM
  6. [SOLVED] Count the total number of shifts worked
    By Schoeii in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-03-2013, 12:41 AM
  7. Replies: 1
    Last Post: 01-02-2012, 02:47 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