Mar 19 2022 04:46 AM
Hi, I have a question ... how can a night shift be calculated automatically? I work from 9.30 pm to the second day at 9.30 am and at night I get paid $ 2 more between 10 pm and 6 am!
Mar 19 2022 04:53 AM
Mar 19 2022 06:32 AM
SolutionHere
it could be
day shift:
=IF(
D2 < C2,
IF(C2>$A$1, 0, $A$1-C2) - IF(D2<$A$2,0, $A$2-D2),
MIN(D2,$A$1) - MAX($A$2,C2) )
total:
=MOD(D2-C2,1)
night shift:
=G2-E2
Mar 19 2022 07:14 AM - edited Mar 19 2022 07:16 AM
Here is a small additional example with file
.....although in hindsight, I like Sergei's example better...recommend it :)):)
Mar 19 2022 06:32 AM
SolutionHere
it could be
day shift:
=IF(
D2 < C2,
IF(C2>$A$1, 0, $A$1-C2) - IF(D2<$A$2,0, $A$2-D2),
MIN(D2,$A$1) - MAX($A$2,C2) )
total:
=MOD(D2-C2,1)
night shift:
=G2-E2