Question : Timesheet Excel Tempalte -- calculating regular,overtime1,overtime<wbr />2

Hi i've developed a timesheet template which calculates the different overtime scenarios based on which state the employee works in. I'm having a problem getting it right for California.
There are 3 rules:
Rule 1: If employee works more than 8 hours in a day they get overtime1 (up to 12 hours worked). If they work more than 12hrs in a day they get Overtime 2 for hours worked over 12.
Rule 2: If employee works more than 40 hours in a week. They get Overtime 1 from that point. If they work more than 12 hours in a day they get Overtime 2.
Rule 3: If they work more than 6 days in a row, they get Overtime 1 for the first 8 hours, then the rest is overtime 2.
- Rule 2 overrides Rule 1 regular hours rule.
- Rule 3 overrides Rule 2 overtime 1 rule.

Below is the timesheet scenario where the regular, overtime1, overtim2 hours have been calculated based on employee entering the Hours Worked each day:
Day      Hours Worked   Regular  Overtime 1  Overtime 2   Running Total
Mon     12                         8               4                    0             12    (Rule 1)
Tue      12                         8               4                   0             24     (Rule 1)
Wed     12                        8               4                   0             36      (Rule 1)
Thu      12                        4                8                   0             48  (Rule 2 -- employee worked over 40 hours)
Fri       12                         0               12                  0             60      (Rule 2 with rule 1  -- 12 hour rule)
Sat     12                          0               12                  0             72      (Rule 2 with rule 1  -- 12 hour rule)
Sun     12                         0                8                   4             84       (Rule 3 working more than 6 days)

I can get Rule 1 easily enough it just having Rule 2 kicking in and then Rule 3. The main issue I found with Rule 2, is that the running total hrs are greater than 40 ocur within a day(see Thu example). So Wed total is 36, hrs, so the first 4 hours for Thu will go to regular the rest to Overtime 1 up to 12 hours.
Can anyone help with the correct formula to use? If attached a basic spreadsheet to illustrate how I've broken it out.
Thanks in advance for your help.
Cheers
Ian

Answer : Timesheet Excel Tempalte -- calculating regular,overtime1,overtime<wbr />2

Hi Ian,

If the daily hours for Mon-Sun are in A3:A9 as in your example then you can put these formulas in row O3:Q3 and fill down to row O9:Q9:

O3 (Regular Hours):

=IF(SUM($A$3:A3)>40,MAX(40-SUM($A2:A$3),0),MIN(8,A3))

P3 (Overtime 1 Hours):

=IF(A3-O3>0,IF(ROWS($A$3:A3)>6,MIN(8,A3-O3),MAX(4,A3-O3)),0)

Q3 (Overtime 2 Hours):

=IF(A3>SUM(O3:P3),A3-SUM(O3:P3),0)

See your revised workbook attached.

Jim
 
Revised Sample Timesheet Workbook
 
Random Solutions  
 
programming4us programming4us