larryvoorhees
New Member
- Joined
- Aug 14, 2017
- Messages
- 7
I recently asked 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 "occurence". 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!
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 "occurence". 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!