SOLVED

Night shift

New Contributor

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!

5 Replies
Sometimes I work from 02.44 to 12.00 or from 16.00 to 03.58 ...
best response confirmed by NikolinoDE (Respected Contributor)
Solution

@gmarko11 

Here

image.png

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

@gmarko11 

Here is a small additional example with file

 

.....although in hindsight, I like Sergei's example better...recommend it :))

 

NikolinoDE

 

Thank you Sergei!!

@gmarko11 , you are welcome