A
APYDS
I want to enter a count formula for a rota I'm doing for my staff using the
24 hour clock. Basically I want to be able to count the number of staff
working in the rota between two selected times without having to put dates
into the rota. The staff work 24 hour shifts so the count has to take
account of the fact that if the rota says a staff member worked between, say,
20:00 and 8:00 that member of staff worked between 8:00 pm on one day to
8:00 am on the following day.
For Monday, for instance, cells b6:b21 contain the start times for the
respective members of staff and cells c6:c21 the end times. Cell B24
contains the selected start time and C24 the selected end time for the
purposes of the count.
I have tried various formulas including:
=IF(B24>=C24, (COUNT(AND(b6:b21>=b24, c6:c21>=(c24+1))),(AND(B6:B21>=B24,
C6:C21<=C24)))
=COUNT(IF(AND((B24>C24)*(B6:B21>=B24)*(C6:C21<=(C24+1))),
(AND(B6:B21>=B24)*(C6:C21<=C24))))
=COUNT(IF(AND((B24>C24),(B6:B21>=B24),(C6:C21<=(C24+1))),
(AND(B6:B21>=B24)*(C6:C21<=C24))))
If the above sounds too complicated, all I want to do is:
if b24 is higher than c24 count where b6:b21 is higher than b24 and c6:c21
is lower than c24 plus 1. If it is not higher than do the same thing except
don't add one at the end.
Thanks in advance for any help out there.
24 hour clock. Basically I want to be able to count the number of staff
working in the rota between two selected times without having to put dates
into the rota. The staff work 24 hour shifts so the count has to take
account of the fact that if the rota says a staff member worked between, say,
20:00 and 8:00 that member of staff worked between 8:00 pm on one day to
8:00 am on the following day.
For Monday, for instance, cells b6:b21 contain the start times for the
respective members of staff and cells c6:c21 the end times. Cell B24
contains the selected start time and C24 the selected end time for the
purposes of the count.
I have tried various formulas including:
=IF(B24>=C24, (COUNT(AND(b6:b21>=b24, c6:c21>=(c24+1))),(AND(B6:B21>=B24,
C6:C21<=C24)))
=COUNT(IF(AND((B24>C24)*(B6:B21>=B24)*(C6:C21<=(C24+1))),
(AND(B6:B21>=B24)*(C6:C21<=C24))))
=COUNT(IF(AND((B24>C24),(B6:B21>=B24),(C6:C21<=(C24+1))),
(AND(B6:B21>=B24)*(C6:C21<=C24))))
If the above sounds too complicated, all I want to do is:
if b24 is higher than c24 count where b6:b21 is higher than b24 and c6:c21
is lower than c24 plus 1. If it is not higher than do the same thing except
don't add one at the end.
Thanks in advance for any help out there.