"So the command MAX is the one that pulls out the duration about a set "X" duration?"
MAX(value,value…) is a function that returns the MAXimum value from a list of one or more values.
H2: MAX("0h",G2−DURATION(,,8,minutes,seconds,milliseconds))
In column H of the first table, MAX is presented with two values on each row:
"0h" — zero hours (and zero minutes, zero seconds and zero milliseconds)
G2-DURATION(,,8,,,) — the duration in cell G2 minus 8 hours.
If G2 is less than 8 hours, the result is a negative duration, 0h is the MAXimum of the two value list, and MAX returns 0h.
If G2 is equal to or greater than 8 hours, the result is 0h or a positive duration value, and MAX returns the result of the subtraction.
" why subtract I33 from SUM(H) to get H33?"
Column H contains all hours over 8 worked in each shift. Up to 2h per shift is paid at 125% of the base rate. Any amount over 2h (in the same shift) is paid at 150% of the base rate.
For the figures shown in the sample table, this person has four shifts which exceeded 8 hours, shown in rows 3, 9, 10, and 17.
Rows 3, 10 and 17, though each have more than 2 hours of OT. The excess is the amount over 10 hours in that shift, calculated in column I. The total of column I, shown in I33, is paid at 150%.
If that total is not subtracted from the total of Column H, where those hours have also been included, then they will also be paid at 125% of the base rate, effectively making the pay rate for hours over 10 275% of the base rate. Nice bonus! ;-)
If you're uncomfortable with that calculation, it ca be avoided with this change in the formula in H2:
existing: H2: MAX("0h",G2−DURATION(,,8,,,))
revised: H2: MIN(MAX("0h",G2−DURATION(,,8,,,)),"2h")
This will return a duration between 0h and 2h.
SUM(H), in H33, will then give you the correct total for amount paid at 125%.
The formulas in column I are unchanged.
Regards,
Barry