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]
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]