Results 1 to 6 of 6

Thread: counting absences conditionally, based on whether or not consecutive

  1. #1

    counting absences conditionally, based on whether or not consecutive



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I recently asked on a different forum about counting "occurrences" and "half-occurrences" in an absence calendar.
    The premise is that row 1 contains a value indicating an absence (UP = unplanned, T = Tardy, LE - Leave Early)
    If the absence is .25 of an hour up to 2 hours, it's half an occurrence, if it's 2 hours or more, it's a full occurrence.
    I was blessed by one of the experts on this forum with a solution to accumulating those values properly, which resulted in the following formula:
    =SUMPRODUCT(COUNTIFS(C94:AG94,{"UP";"T";"LE"},C95:AG95,">2")+(COUNTIFS(C94:AG94,{"UP";"T";"LE"},C95:AG95,">=0.25",C95:AG95,"<=2")*0.5))

    So a huge thank you for that. Now, on to my next dilemma:

    If a person has an Unplanned absence on Monday, Tuesday and Wednesday, we can only "count" it as one "occurrence". However, if the person is gone again (still) on Thursday, that begins the count of another occurrence. So in essence, a person can be gone up to 3 consecutive days, and it counts as one occurrence. The fourth consecutive day begins the count of the "next" occurrence (which could be 3 more consecutive days). This only applies to the "UP" value, not the "T" or "LE" value.
    Any thoughts on how to do that? Especially considering it could (technically) span a weekend? My current workbook has blank/grayed-out cells for the weekends and holidays.
    Any help would be greatly appreciated! Thanks!

  2. #2
    Super Moderator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    677
    Articles
    0
    Please post links to all other forums where you have posted this query. Thanks.
    Ali
    Enthusiastic self-taught user of MS Excel!

  3. #3
    Yes, ma'am. It was on the Mr. Excel forum.
    https://www.mrexcel.com/forum/excel-...nsecutive.html
    Thank you very much. I greatly appreciate any assistance I can get on this one. It's really got me puzzled.

  4. #4
    Super Moderator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    677
    Articles
    0
    Thanks. I suggest you attach a sample workbook showing the issue.
    Ali
    Enthusiastic self-taught user of MS Excel!

  5. #5
    Thank you, ma'am. I shall attempt to do so.
    Attached Files Attached Files

  6. #6
    Well...I knew it was a problem. I just didn't realize that it was quite that difficult of a problem. Well, at least I don't feel quite so bad for not having been able to puzzle it out on my own. Anybody?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •