+ Reply to Thread
Results 1 to 13 of 13

Count Consecutive Days of Absence Per Staff

  1. #1
    Registered User
    Join Date
    12-24-2020
    Location
    singapore
    MS-Off Ver
    enterprise
    Posts
    5

    Count Consecutive Days of Absence Per Staff

    Can you please help me? What i want to do is indicate a Y or N on the 3rd column, if the date on the 2nd column is consecutive for the staff. On the 4th column, id like to know how many days is the duration of the consecutive dates.

    Screenshot 2020-12-24 at 7.10.28 PM.png

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Count Consecutive Days of Absence Per Staff

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-24-2020
    Location
    singapore
    MS-Off Ver
    enterprise
    Posts
    5

    Re: Count Consecutive Days of Absence Per Staff

    Quote Originally Posted by shenggay18 View Post
    Can you please help me? What i want to do is indicate a Y or N on the 3rd column, if the date on the 2nd column is consecutive for the staff. On the 4th column, id like to know how many days is the duration of the consecutive dates.

    Attachment 710248
    attaching excel file.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,627

    Re: Count Consecutive Days of Absence Per Staff

    Consecutive days up to what date. What about weekends and holidays.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    12-24-2020
    Location
    singapore
    MS-Off Ver
    enterprise
    Posts
    5

    Re: Count Consecutive Days of Absence Per Staff

    Quote Originally Posted by kvsrinivasamurthy View Post
    Consecutive days up to what date. What about weekends and holidays.
    continuous consecutive days, regardless of weekends and holidays.

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

    Re: Count Consecutive Days of Absence Per Staff

    If I understand correctly in C2 and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and in D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

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

    Re: Count Consecutive Days of Absence Per Staff

    With H2:H9 is holidays

    In C2

    Please Login or Register  to view this content.
    Note that: if 1-Jan-20 is holiday, Mary has absence in 31-Dec-19 and 2-Jan-20, this day "2-Jan-20" indicates "Y"

    D2:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  8. #8
    Registered User
    Join Date
    12-24-2020
    Location
    singapore
    MS-Off Ver
    enterprise
    Posts
    5

    Re: Count Consecutive Days of Absence Per Staff

    Quote Originally Posted by FlameRetired View Post
    If I understand correctly in C2 and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and in D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    hi, thank you for your reply. the first formula works but the 2nd one does not meet the condition. I want to count the number of days per duration. so for example, 1st absence instance is 5 days, it should be 5 on column D, if there is a 2nd absence instance and it is for 3 days, i should have 3 on column D.

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,627

    Re: Count Consecutive Days of Absence Per Staff

    In C2 then copy down

    =IFERROR(IF(INDEX($B$1:$B1,AGGREGATE(14,6,ROW($A1:$A$2)/($A1:$A$2=$A2),1))=$B2-1,"Y","N"),"N")

    In D2 then copy down

    =IF(C2="N","",SUMPRODUCT(--(INDEX($A$1:$A2,AGGREGATE(14,6,ROW($A$1:$A2)/(($A$1:$A2=$A2)*($C$1:$C2="N")),1)):$A2=$A2)))
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,627

    Re: Count Consecutive Days of Absence Per Staff

    If you want display only on the last day of absence .
    In D2 then copy down
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 12-27-2020 at 05:55 AM.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,194

    Re: Count Consecutive Days of Absence Per Staff

    That's neat, Sir. It's not the last value, though. It's the last one, IF they are consecutive down the column, othwerwise it's the first. But a very nice solution!!
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,627

    Re: Count Consecutive Days of Absence Per Staff

    Dear Glenn Kennedy

    I mean the last day of consecutive absence in that period.
    Thanks for the comments.

  13. #13
    Registered User
    Join Date
    12-24-2020
    Location
    singapore
    MS-Off Ver
    enterprise
    Posts
    5

    Re: Count Consecutive Days of Absence Per Staff

    AMAZING! Thank you so much!

+ 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: 17
    Last Post: 02-14-2024, 07:07 AM
  2. Count Consecutive Occurrences of Absence including weekends
    By Polymorph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2021, 05:23 PM
  3. [SOLVED] Staff Absence Tracker - showing number of days and number of occasions
    By chergar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-15-2020, 04:14 AM
  4. [SOLVED] Count days falling within given period (with criteria)(absence tracker)
    By annazet in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2020, 05:04 AM
  5. [SOLVED] Count Consecutive & Non consecutive days per given logic
    By asimraza89 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2019, 04:31 PM
  6. Consecutive days count with multiple staff
    By 01271676 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-19-2019, 03:01 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