+ Reply to Thread
Results 1 to 9 of 9

Count consecutive days of absence

Hybrid View

  1. #1
    Registered User
    Join Date
    12-26-2021
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    13

    Post Count consecutive days of absence

    Hello everyone
    I am trying to create a formula that will count the days of absence for each person, but only the days of continuous absence.
    In the first column :person number,
    2nd column: starting day ,
    3rd column: end day

    I've tried to do this with formulas, but i was able to find max/min date, but the point is to count consecutive days. I
    maybe it's posibble to do this in power query ?
    I will be grateful for any tips.
    in attachment sample data.


    Best regards,
    Mark


    PS. Merry Christmas
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Count consecutive days of absence

    What about
    D2=[@[absent to]]-[@[absent from]]+1
    Then you could use a Pivot Table to make the complete sum
    Attached Files Attached Files
    Last edited by PCI; 12-26-2021 at 12:08 PM.
    - Battle without fear gives no glory - Just try

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

    Re: Count consecutive days of absence

    No, 'cos 10031 should be 4 and 12 (two occasions) not 16.
    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

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

    Re: Count consecutive days of absence

    Pl see file.
    In F2 then copied down

    =IFERROR(IF($B2<>SUM($C1)+1,IF($C2<>$B3-1,$C2-$B2+1,IF($A3=$A2,AGGREGATE(14,6, ($C$3:$C$55)/(($B$3:$B$55=($C$2:$C$54+1))*($A$3:$A$55=$A2)),1)-$B2+1)),""),"")
    If last date of continuous absence is required, in H2 then copied down

    =IFERROR(IF($B2<>SUM($C1)+1,IF($C2<>$B3-1,$C2,IF($A3=$A2,AGGREGATE(14,6, ($C$3:$C$55)/(($B$3:$B$55=($C$2:$C$54+1))*($A$3:$A$55=$A2)),1))),""),"")
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 12-26-2021 at 01:45 PM.
    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
    10-28-2022
    Location
    London
    MS-Off Ver
    2019
    Posts
    1

    Re: Count consecutive days of absence

    This is brilliant but been trying to work out if the employee is still on sick leave(no end date)so I need a continuous count from the start day to ongoing calendar day,
    I hope this makes sense

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

    Re: Count consecutive days of absence

    kvs... that looks like it!! I have been playing with this from time to time all day with no luck.... If it's correct it's lovely.

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

    Re: Count consecutive days of absence

    Quote Originally Posted by Glenn Kennedy View Post
    kvs... that looks like it!! I have been playing with this from time to time all day with no luck.... If it's correct it's lovely.
    Thanks for the positive comments.

  8. #8
    Registered User
    Join Date
    12-26-2021
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    13

    Re: Count consecutive days of absence

    I'm looking at it and can't believe my eyes
    Absolutely fantastic solution.
    thank you very much Sir.

    Best regards,
    Mark

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

    Re: Count consecutive days of absence

    @Mark123321
    Thanks for the feedback.
    Pl mark the thread solved.

+ 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. Count Consecutive Days of Absence Per Staff
    By shenggay18 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-27-2020, 06:02 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. Replies: 17
    Last Post: 08-03-2015, 06:15 AM
  7. Count Consecutive Days (with rule associated)
    By DUNC78 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2015, 10:18 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