counting absences conditionally, based on whether or not consecutive

larryvoorhees

New member
Joined
Aug 16, 2017
Messages
4
Reaction score
0
Points
0
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!
 
Please post links to all other forums where you have posted this query. Thanks.
 
Thank you, ma'am. I shall attempt to do so.
 

Attachments

  • Absence Calendar sample.xlsx
    117.5 KB · Views: 17
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?
 
Back
Top