+ Reply to Thread
Results 1 to 4 of 4

Count Consecutive Occurrences of Absence including weekends

  1. #1
    Registered User
    Join Date
    06-15-2020
    Location
    United States
    MS-Off Ver
    2007
    Posts
    1

    Count Consecutive Occurrences of Absence including weekends

    I have a massive data file containing employee hours. They log specific charge numbers that determine the type of work they were doing/if they are absent

    Since COVID hit, we have had more employees absent. This is a problem because some of them will have to get re-certified if they exceed a certain amount of absent days (including weekends).

    There are around 10 different charge numbers that mean 'absent from facility'. Our task is to determine all the consecutive days that they charged any of those 10 numbers. As soon as an employee reaches 20 consecutive days, we would record it(doesn't really matter how/where we record the names, as long as we have a list of everyone who exceeds 20 days). If the employee shows up for at least one day, then the count would reset. The problem is that we don't log charge numbers for the weekends(Saturday and Sunday) and they have to be included in the count.

    I am trying to do this in excel, but have no idea how to include the weekends, when there is no specific record for them. I'm an experienced programmer, I just have no idea where to start or what resources to look at to achieve this. Maybe excel might not be the right place to do this, but any direction is appreciated. (let me know if I am not clear, created an example file below)
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Count Consecutive Occurrences of Absence including weekends

    Try this: Change the red two to a twenty for a real run. In your sample Zeus was absent twice and Rudyard thrice, consecutively

    Please Login or Register  to view this content.
    Last edited by xladept; 06-15-2020 at 04:48 PM.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    03-09-2011
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2016, O365
    Posts
    18

    Re: Count Consecutive Occurrences of Absence including weekends

    xladept,

    I have 3 questions on this post....
    1) I'm not familiar with the ' : ' (colon) throughout the Sub...could you explain?
    2) The code is fast and I think I might be able to adapt it for my use.... Could you comment the code so I might be able to understand it and configure it to my situation?
    3) Rudyard has 3 consecutive days absent, but when I run the code, K2 = 2, so I'm not sure what its telling me....could you explain?

    Thx,
    Don

  4. #4
    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,421

    Re: Count Consecutive Occurrences of Absence including weekends

    Administrative Note:

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    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.

+ 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. Count number of occurances including weekends.
    By mthoma3 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-24-2019, 08:08 PM
  2. [SOLVED] How to Exclude Weekends in Employee Absence Tracker Count
    By pugz in forum Excel General
    Replies: 20
    Last Post: 07-30-2018, 03:09 AM
  3. Count the number of occurrences of consecutive absences
    By MissC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-28-2017, 11:18 PM
  4. [SOLVED] Count Consecutive Occurrences
    By dlow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2014, 12:50 AM
  5. [SOLVED] Count number of occurrences but if there are consecutive matches count them as one
    By michaljireht in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-26-2013, 08:26 PM
  6. Count consecutive number of negative occurrences >=3
    By nbiggss in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-02-2012, 02:14 PM
  7. Count the number of consecutive occurrences
    By timmycl_7 in forum Excel General
    Replies: 12
    Last Post: 05-03-2012, 02:04 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