Forum Discussion
How to count number of employees days on work between 2 dates (countif etc)
Let's say the start dates are in B3:B10 and the finish dates in C3:C10.
The lit of dates below starts in A15.
In B15:
=COUNTIFS($B$3:$B$10, "<="&A15, $C$3:$C$10, ">=&A15)
Fill down.
- Swe_MackFeb 11, 2024Copper ContributorThanks for helping out! I made a simple excel and put the boxes in. But I can't get it to work..
https://1drv.ms/x/s!AgVMgapiFJvPgZAwNWKDix56QnnYSw?e=sDzfak
Ideas?- HansVogelaarFeb 11, 2024MVP
I forgot one quote, but the formula has to be different since the start and finish values have a time component.
I have updated your workbook.
- Swe_MackFeb 16, 2024Copper Contributor
The counter is working really good.
I would like to improve it...
I dont wanna count the days in the "middle" when 2 persons swap place.
As of now, I I have to se where 2 dates are meeting, and then take -1 on that count.
I have drawn lines where dates meet. On those places I wanna remove 1 from the count.
Analogy.
Imagine these dates represent people on a boat. And my job is to see which people are on "duty" that day. And all date lines are when people are working, and on the last day of work, I don't wanna count them as active if that makes sense. Bc they are leaving that day. So I wanna remove the last day IF that date line meets another date coming out... Always keeping track on people on active duty.
So i was thinking... if some compare function can do that. If comparing 2 dates and in that way remove one from that day.