counting absences conditionally, based on whether or not consecutive

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!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Cross-posted: counting absences conditionally, based on whether or not consecutive

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule #13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Thank you, sir. I appreciate the guidance. As I'm a tad unclear what "cross-posting" is, I'll do my best.
My original question (regarding the formula I mentioned in the first paragraph) was posted on this site, and that question answered. I included it in my explanation of this question merely as background.
As for other forums where I have posted this question (regarding the counting absences conditionally - consecutive), I have also posted this same question to the forum excelguru.com. I am hopeful that by having it appear in more than one forum, I may find someone who can come up with an answer. Here is the URL for that posting:
counting absences conditionally, based on whether or not consecutive
Is that the correct way to do this?
Thank you again for your patience and your kindness. i greatly appreciate it.
 
Upvote 0
Is that the correct way to do this?
Yes, just mentioning that you have posted to other sites and providing links to those other posts is sufficient.
The only other thing which is preferred, is if it is solved on one of the other sites, just to come back to this thread and post that it has been solved (with a link to that thread).

Thanks
 
Upvote 0
Will do, thank you sir. I greatly appreciate the work that you (and the rest of the moderators) do. I've been the admin and mod for other bulletin boards, and I know how much work and dedication it takes. My sincere thanks!
 
Upvote 0
Will do, thank you sir. I greatly appreciate the work that you (and the rest of the moderators) do. I've been the admin and mod for other bulletin boards, and I know how much work and dedication it takes. My sincere thanks!
Thank you. We appreciate that!:)
 
Upvote 0

Forum statistics

Threads
1,214,959
Messages
6,122,476
Members
449,087
Latest member
RExcelSearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top