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
[TABLE="width: 324"]
<colgroup><col><col span="4"></colgroup><tbody>[TR]
[TD]Start time site[/TD]
[TD]Stop time site[/TD]
[TD]Total Working time[/TD]
[TD]Total
Regular
Working
time[/TD]
[TD]Total
Overtime[/TD]
[/TR]
[TR]
[TD]7:00[/TD]
[TD]17:00[/TD]
[TD]10:00[/TD]
[TD]10:00[/TD]
[TD]0:00[/TD]
[/TR]
[TR]
[TD]6:00[/TD]
[TD]12:00[/TD]
[TD]6:00[/TD]
[TD]5:00[/TD]
[TD]1:00[/TD]
[/TR]
[TR]
[TD]9:00[/TD]
[TD]18:00[/TD]
[TD]9:00[/TD]
[TD]0:00[/TD]
[TD]9:00[/TD]
[/TR]
[TR]
[TD]15:00[/TD]
[TD]18:00[/TD]
[TD]3:00[/TD]
[TD]0:00[/TD]
[TD]3:00[/TD]
[/TR]
[TR]
[TD]18:00[/TD]
[TD]20:00[/TD]
[TD]2:00[/TD]
[TD]0:00[/TD]
[TD]2:00[/TD]
[/TR]
[TR]
[TD]18:00[/TD]
[TD]6:00[/TD]
[TD]########[/TD]
[TD]0:00[/TD]
[TD]########[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]0:00[/TD]
[TD]0:00[/TD]
[TD]0:00[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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