Excel timesheet with overtime: the formulas that handle night shifts and breaks
Tracking hours and overtime in Excel is simple once the formulas are set up right. Here is the layout I use, with the formulas that avoid the usual mistakes (night shifts, unpaid breaks, overtime pay). Layout Col Header Example A Date 2026-11-02 B Start 08:00 C End 17:30 D Unpaid break (minutes) 30 E Hours worked formula F Regular hours formula G Overtime hours formula Format B and C as Time…
Calculating hours and overtime in Excel becomes straightforward when the formulas are correctly configured. The setup I employ helps to avoid common errors such as night shifts, unpaid breaks, and miscalculating overtime pay. The layout consists of columns for the date, start time, end time, unpaid break duration in minutes, regular and overtime hours, and the final pay.
The date, start time, and end time are entered in cells A, B, and C respectively. The unpaid break duration is recorded in minutes in column D. To ensure accuracy, the date and time columns are formatted as date and time (hh:mm), while the calculated hours are formatted as numbers with two decimal places in columns E, F, and G.
The key formula to calculate total hours worked, including night shifts, is located in cell E2: =MOD(C2-B2,1)*24-D2/60. This formula accounts for overnight shifts by wrapping the time difference around midnight. Excel represents time as a fraction of a day, thus multiplying the result by 24 converts it into hours. Break time is then subtracted from this total to get the actual hours worked.
To determine regular and overtime hours, the 8-hour daily limit is applied. In cell F2, the formula =MIN(8,E2) is used to calculate regular hours, ensuring they do not exceed 8. For overtime hours, the formula =MAX(0,E2-8) in cell G2 calculates any hours beyond the limit, ensuring a zero result if there is no overtime. For a weekly overtime threshold (such as 40 hours), the weekly total can be summed and compared with the limit using =MAX(0,SUM(E2:E8)-40).
To calculate pay, the hourly rate is entered in cell J1, and the overtime multiplier (typically 1.5) in J2. The formulas in cells E2:G8 sum up the regular and overtime hours, respectively. The final pay is then computed with the formula =SUM(F2:F8)*$J$1 + SUM(G2:G8)*$J$1*$J$2. The use of dollar signs locks the cells, allowing the formula to be copied down without errors.
A frequent mistake to avoid is entering times as text (e.g., "8.30" instead of "08:30"), as Excel cannot perform calculations on text values. Another mistake is neglecting to account for unpaid breaks or using a simple subtraction method for calculating night shifts. Additionally, totals exceeding 24 hours can appear incorrectly unless the cell format is adjusted to [h]:mm to display hours and minutes correctly.
For those preferring not to create these formulas from scratch, I have made ready-to-use Excel templates available at affordable prices. A Timesheet & Overtime template is priced at $5, the Staff Shift Rota template costs $6, and a comprehensive Office Template Bundle, including six templates and a guide, is available for $29. These templates provide a convenient starting point for anyone looking to implement these calculations in their Excel spreadsheets.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to