Forum Discussion
Counting the number of working staff during specific time periods
Jen_Sova It worked. I created a simple LAMBDA function called Toffset that will +1 any time < 7am or whatever time you pick. I then used a formula
SUMPRODUCT( (Toffset(start_range) <= Toffset(Start_time) ) * (Toffset(end_range) >= Toffset(End_time) ) )
I used $ to 'lock' columns/rows as needed so I could easily copy down and across
I also added 9/24 to the Toffset for the END times so any end time like 7:30 was also interpreted as the next day also (i.e. up to 9am)
I added a FILTER at the bottom just to 'copy' the values above so I could more easily do a manual check
I started to highlight the correct outputs green and wrong red but after 2 days stopped as it looks like my formula is working.
Let me know if you have more questions.
BTW I changed to SUMPRODUCTS because that will handle an array while COUNTIFS requires a cell range.