Hello all,
In the company I work we use two time frames for different pay rate. The day shift is between 6am and 10pm and the night shift is between 10pm and 6am on the next day. How can write a code to calculate amount of hours worked in each shift? The only input fields should be start and end time.
I would like it to be like this:
[TABLE="width: 393"]
<tbody>[TR]
[TD]Example[/TD]
[TD]Start time[/TD]
[TD]End time[/TD]
[TD]Day shift[/TD]
[TD]Night shift[/TD]
[TD]Total hours:[/TD]
[/TR]
[TR]
[TD="align: right"]01.10.2012[/TD]
[TD]18:00[/TD]
[TD]6:00[/TD]
[TD]4:00[/TD]
[TD]8:00[/TD]
[TD]12:00[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am calculating the total amount of hours worked like this:
=IF(OR(C6="";D6="");"";MOD(D6-C6;1))
Thanks!
In the company I work we use two time frames for different pay rate. The day shift is between 6am and 10pm and the night shift is between 10pm and 6am on the next day. How can write a code to calculate amount of hours worked in each shift? The only input fields should be start and end time.
I would like it to be like this:
[TABLE="width: 393"]
<tbody>[TR]
[TD]Example[/TD]
[TD]Start time[/TD]
[TD]End time[/TD]
[TD]Day shift[/TD]
[TD]Night shift[/TD]
[TD]Total hours:[/TD]
[/TR]
[TR]
[TD="align: right"]01.10.2012[/TD]
[TD]18:00[/TD]
[TD]6:00[/TD]
[TD]4:00[/TD]
[TD]8:00[/TD]
[TD]12:00[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I am calculating the total amount of hours worked like this:
=IF(OR(C6="";D6="");"";MOD(D6-C6;1))
Thanks!