I've created a spreadsheet for work to calculate wages. I need to automate some of the penalty rates and it is proving beyond my capability.
I need a couple formulas to measure duration between two times, and duration after a specific max number is met.
I've managed to figure out how to automate the hours worked from a start and an end time with breaks deducted accounting for times past midnight using:
X1=Total hours workedA=Start TimeB=End TimeC=Break
X1=B-A+(B<A)-C
I've managed calculate total pay for the day using the below formula:
P=Gross PayX=hoursR=Rate
P=((TIMEVALUE(X)*24)*R)
My issue is that the only hours that are automated are the regular hours. I have to manually input the penalty rates as they are more complex.
Example below:
[Start:1100 End:0300]Regular hours = 0600-2200 (11hrs)Late Night Hours = 2200-0000 (2hrs)Early morning Hours = 0000-0600 (3hrs)First two hours overtime - after 12hrs/day or 38hrs/week (2hrs)After two hours overtime - after 12hrs/day or 38hrs/week (1hr)
Any help would be much appreciated.
https://docs.google.com/spreadsheets/d/1K4fkjtcU8OEDLmjZLxkU_OwusSeQ7KFnJxhv4dHXzbY/edit?usp=sharing