+ Reply to Thread
Results 1 to 13 of 13

Consecutive days count with multiple staff

  1. #1
    Registered User
    Join Date
    08-16-2019
    Location
    Cornwall
    MS-Off Ver
    2010
    Posts
    5

    Consecutive days count with multiple staff

    Hi all

    I'm sure this is straight forward but my limited brain power is....well....limited. How can I get Excel to calculate the maximum number of consecutive days per employee, i.e., Person 2 = '2' as there are 4 periods when the consecutive days do not go past 2 days.
    A B C
    Name Actual Start Date Actual End Date
    Person 1 01/08/2019 01/08/2019
    Person 2 01/08/2019 01/08/2019
    Person 1 01/08/2019 01/08/2019
    Person 1 01/08/2019 01/08/2019
    Person 2 05/08/2019 05/08/2019
    Person 2 07/08/2019 07/08/2019
    Person 1 08/08/2019 08/08/2019
    Person 2 08/08/2019 08/08/2019
    Person 1 08/08/2019 08/08/2019
    Person 1 08/08/2019 08/08/2019
    Person 2 14/08/2019 14/08/2019
    Person 1 15/08/2019 15/08/2019
    Person 2 15/08/2019 15/08/2019
    Person 2 19/08/2019 19/08/2019
    Person 2 21/08/2019 21/08/2019
    Person 1 22/08/2019 22/08/2019
    Person 2 22/08/2019 22/08/2019
    Person 1 22/08/2019 22/08/2019
    Person 1 22/08/2019 22/08/2019
    Person 2 28/08/2019 28/08/2019
    Person 1 29/08/2019 29/08/2019
    Person 2 29/08/2019 29/08/2019
    Person 1 29/08/2019 29/08/2019
    Person 1 29/08/2019 29/08/2019
    Person 1 29/08/2019 29/08/2019
    etc...

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive days count with multiple staff

    What's the answer you'relooking for here?

    Is it the value 4 for person 2, and presumably 0 for person 1?
    Last edited by Richard Buttrey; 09-16-2019 at 09:31 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive days count with multiple staff

    With a helper column D and in D2 copied down

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


    Now with the name Person 2 in say G3, in H3 use
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-16-2019
    Location
    Cornwall
    MS-Off Ver
    2010
    Posts
    5

    Re: Consecutive days count with multiple staff

    Hi Richard

    The answer I would be looking for person 2 would be '2' as they have not worked more than 2 consecutive days in August.

    Thanks

    Stuart

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive days count with multiple staff

    I'ma attaching a workbook containing your data. Please note you should always supply these rather than just listing information as text.

    I count 4 consecutive dayas using the formula I gave you.

    End on 7/8/2019 Start on 8/8/2019
    End on 14/8/2019 Start on 15/8/2019
    End on 21/8/2019 Start on 22/8/2019
    End on 28/8/2019 Start on 29/8/2019

    Please explain how you are counting just 2. Your OP mentioned 4.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-16-2019
    Location
    Cornwall
    MS-Off Ver
    2010
    Posts
    5

    Re: Consecutive days count with multiple staff

    Sorry but this formula only results in an answer of 0 for all rows

    [QUOTE=Richard Buttrey;5194810]With a helper column D and in D2 copied down

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

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive days count with multiple staff

    [QUOTE=01271676;5194837]Sorry but this formula only results in an answer of 0 for all rows

    Quote Originally Posted by Richard Buttrey View Post
    With a helper column D and in D2 copied down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Have you opened and looked at the workbook I uploaded?

  8. #8
    Registered User
    Join Date
    08-16-2019
    Location
    Cornwall
    MS-Off Ver
    2010
    Posts
    5

    Re: Consecutive days count with multiple staff

    Thankyou Richard and my apologies for not attaching workbook

    Your formula is counting periods whereas I am looking for the highest amount of consecutive days worked, i.e., all 4 periods you mention are no more than 2 days each time, therefore the highest consecutive days would be 2. If it went from 7/8/18 - 9/8/19 the answer would be 3.

    Stuart

    Quote Originally Posted by Richard Buttrey View Post
    I'ma attaching a workbook containing your data. Please note you should always supply these rather than just listing information as text.

    I count 4 consecutive dayas using the formula I gave you.

    End on 7/8/2019 Start on 8/8/2019
    End on 14/8/2019 Start on 15/8/2019
    End on 21/8/2019 Start on 22/8/2019
    End on 28/8/2019 Start on 29/8/2019

    Please explain how you are counting just 2. Your OP mentioned 4.

  9. #9
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Consecutive days count with multiple staff

    Richard I think it is slightly unclear, but it is the maximum run of consecutive days in the period. So whilst consecutive days occur on 4 occasions which you have identified, the thread is wanting 2 as an answer, all be it that it occurred on 4 occasions!

    If the list could be sorted by employee and then date it is an easy task with a helper column
    in d3 =IF(B3=B2,D2,IF(B3=B2+1,D2+1,1))

    then you want the maximum of this when the person is the person of interest

    as an array
    =MAX(IF(A:A=G2,D:D,""))

    Although I assume that there are no weekends in the formula so Friday Monday is consecutive

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive days count with multiple staff

    Yes,

    Good work there Dave. It was a little confusing but sorting it as you've done would seem the most pragmatic approach.

  11. #11
    Registered User
    Join Date
    08-16-2019
    Location
    Cornwall
    MS-Off Ver
    2010
    Posts
    5

    Re: Consecutive days count with multiple staff

    Thanks Dave

    There are weekends to be included. How would this change the formula?

    Stuart

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

    Re: Consecutive days count with multiple staff

    How about:
    1. Holidays
    2. Vacation
    3. Sick days
    4. Other days off
    And how exactly do you want weekends and others handled?
    Dave

  13. #13
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Consecutive days count with multiple staff

    You really need to give data displaying your scenarios and the result, as highlighted in the previous post
    =IF(B4=B3,D3,IF(OR(B4=B3+1, AND(B4=B3+3, WEEKDAY(B3)=6)),D3+1,1))

    would account for weekends perhaps

+ 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. How to count number of consecutive days
    By dobracik in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-05-2016, 03:10 PM
  2. Need formula to count consecutive days
    By emp2013 in forum Excel General
    Replies: 0
    Last Post: 06-27-2016, 01:57 PM
  3. Replies: 17
    Last Post: 08-03-2015, 06:15 AM
  4. Count Consecutive Days (with rule associated)
    By DUNC78 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2015, 10:18 AM
  5. [SOLVED] How to count 10 consecutive week days
    By rjassal82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-16-2013, 05:40 AM
  6. count consecutive negative days
    By pault22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2010, 08:10 AM
  7. Multiple Days Hourly staff count
    By aehartle in forum Excel General
    Replies: 14
    Last Post: 05-19-2010, 11:42 AM

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