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

1. ## counting absences conditionally, based on whether or not consecutive

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. Please post links to all other forums where you have posted this query. Thanks.

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. Thanks. I suggest you attach a sample workbook showing the issue.

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

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?