Project: A Timesheet
About this lesson
A timesheet is overtime as MAX of hours-over-standard and zero. Pay is ordinary hours at one locked rate plus overtime at another. Underneath sit a SUM, a NETWORKDAYS and a SUMIF.
- build a timesheet with overtime, two pay rates and a weekly total.
- keep every rate in a cell so a pay rise is one edit.
The idea
The last project, and the one most people build for themselves. Overtime is the MAX floor from Everyday Math. Pay is two products added, with the rates locked in cells. The summary is three functions from three different modules.
Everything that might change lives in a cell: the standard day, the two rates. A timesheet with 15 typed into six formulas is a timesheet that will be wrong after the next pay review. It will look right until somebody checks.
The mistake to watch for
Overtime as a plain subtraction. Hours minus the standard day goes negative on a short day. Then it pays the person less than their ordinary hours. MAX with a floor of 0 is what overtime means. And the rates and the standard day live in cells. 15 typed into six formulas is wrong after the next pay review. It looks right until somebody checks.
Read more about this
Where this comes up again
This lesson needs JavaScript to run. Everything below is the lesson in full, but you cannot type into the grid or be marked.
In D2, type:
=MAX(C2-$B$9,0)
This fills down to D7.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Day | Date | Hours | Overtime | Pay | ||
| 2 | Mon | 45369 | 8 | ||||
| 3 | Tue | 45370 | 9.5 | ||||
| 4 | Wed | 45371 | 8 | ||||
| 5 | Thu | 45372 | 10 | ||||
| 6 | Fri | 45373 | 7.5 | ||||
| 7 | Sat | 45374 | 4 | ||||
| 8 | |||||||
| 9 | Standard day | 8 | Working days | ||||
| 10 | Rate | 15 | Overtime hours | ||||
| 11 | Overtime rate | 22.5 | |||||
| 12 | Total pay |
Every step
-
In
D2, type:=MAX(C2-$B$9,0). This fills down toD7. -
Read
=MAX(C3-$B$9,0)and say what it returns. -
In
E2, total ordinary pay plus overtime pay. Lock both rates so it fills down. -
In
B12, totalE2:E7withSUM. -
In
E9, count the working days fromB2toB7withNETWORKDAYS. -
In
E10, total the overtime hours above zero withSUMIF.