Hello all,

I am attempting to come up with a formula that will help me calculate overtime in California. I found a few previous posts, but none that meet all of the requirements. Employees get overtime in CA for:

More than 8 hours are worked in a day (up to 12)
More than 40 hours are worked in a week
Hours worked on the 7th consecutive day (up to 8)

Employees get double overtime for:
More than 12 hours are worked in a day
More than 8 hours worked on the 7th consecutive day

To eliminate the the 7th day issues, I am just using helper cells for hours worked on the 7th day of the work week. So far, what I have is what I found in a previous post:

=MAX(0,SUM(A13:A26)-40-SUMIF(A13:A26,">8")+8*COUNTIF(Daily Total Hours,">8"))+SUMIF(A13:A26,">8")-8*COUNTIF(A13:A26,">8")

This will calculate the hours of overtime over 40 in a week and 8 in a day, but will not differentiate between hours 8-12 and hours 12-??. Does anyone have suggestions?