When Overtime is given, reduce night hours

S

sonar

Hi

I have this problem with my spreadsheet.

If my overtime and my night hours falls at the same times, overtim
takes presidence.

it is as follows:



I need to do the following for the Keytimers night shift hours:

CD18 = text column

CB18 = my overtime

CC18 = my night time [
(IF((CD18)<>"",0,(IF(OR(BW18=0,BX18=0),0,(IF(BW18<TIME(7,0,0),TIME(7,0,0)-BW18,0))+(IF(BX18>TIME(19,0,0),BX18-TIME(19,0,0),0))))))
]


What I want to do is the following instruction:


=IF((CD18)<>"",0,(IF(CB18>CC18,(CB18-CC18),(CC18-CB18)))


I tried to do this in the following way:


=IF(CB18<(IF((CD18)<>"",0,(IF(OR(BW18=0,BX18=0),0,(IF(BW18<TIME(7,0,0),TIME(7,0,0)-BW18,0))+(IF(BX18>TIME(19,0,0),BX18-TIME(19,0,0),0)))))),


(IF((CD18)<>"",0,(IF(OR(BW18=0,BX18=0),0,(IF(BW18<TIME(7,0,0),TIME(7,0,0)-BW18,0))+(IF(BX18>TIME(19,0,0),BX18-TIME(19,0,0),0)))-CB18))),


(IF((CD18)<>"",0,CB18-(IF(OR(BW18=0,BX18=0),0,(IF(BW18<TIME(7,0,0),TIME(7,0,0)-BW18,0))+(IF(BX18>TIME(19,0,0),BX18-TIME(19,0,0),0))-CB18)))))


But it did not work the way I wanted it to.



Or would this do?

=IF((CD17)<>"",0,IF(CB>IF(OR(BW17=0,BX17=0),0,(IF(BW17<TIME(7,0,0),TIME(7,0,0)-BW17,0))+(IF(BX17>TIME(19,0,0),BX17-TIME(19,0,0),0))))),CB-(IF(OR(BW17=0,BX17=0),0,(IF(BW17<TIME(7,0,0),TIME(7,0,0)-BW17,0))+(IF(BX17>TIME(19,0,0),BX17-TIME(19,0,0),0)))))),((IF(OR(BW17=0,BX17=0),0,(IF(BW17<TIME(7,0,0),TIME(7,0,0)-BW17,0))+(IF(BX17>TIME(19,0,0),BX17-TIME(19,0,0),0))))))-CB17)



What can you guys recommend?

Regards
Sona
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top