calculating worktime and overtime

bartvdg

Board Regular
Joined
Sep 27, 2009
Messages
65
I'm trying to calculate overtime and working time based on the start time and stop time given.
The criteria are:
Valid working time is between 07:00 and 17:00 all other time outside this slot is overtime. to calculate the time is not the issue, it is when somene starts or stops the time outside this slot.
eg. from 18:00 to 06:00 gives me negative number and I'm stuck.

the formula gets to big and I'm getting stuck on this, maybe there is a simpeler way...
=IF(OR(E14>'Data lists'!$J$1;F14>'Data lists'!$J$2);F14-E14;IF(OR(E14="";E14>'Data lists'!$J$1);0;('Data lists'!$J$1-E14))+IF(OR(F14="";F14<'Data lists'!$J$2);0;(F14-'Data lists'!$J$2)))

E F G H I
Start time siteStop time siteTotal Working timeTotal
Regular
Working
time
Total
Overtime
7:0017:0010:0010:000:00
6:0012:006:005:001:00
9:0018:009:000:009:00
15:0018:003:000:003:00
18:0020:002:000:002:00
18:006:00########0:00########
0:000:000:00

<colgroup><col><col span="4"></colgroup><tbody>
</tbody>
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
enter your times as dd/mm/yy hh:mm then subtract first time from second time [display as hh:mm]
 
Upvote 0
Hi Bart

I think this covers it . . .
Total Working Time:
Code:
=F2-E2
Total Overtime:
Code:
=MAX(7/24-E2;0)-MAX(7/24-F2;0)-MAX(E2-17/24;0)+MAX(F2-17/24;0)
Total Regular Working time = Total Working Time - Total Overtime

Make sure that the stop time ( F2 ) is larger than start-time ( E2 ), if not . . add 1 (=day) to the stop time
 
Last edited:
Upvote 0
OK dank voor de terugkoppeling . .
succes!

Sorry, I mean: thx for the feedback, good luck
 
Last edited:
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top