How to Calculate Excel Overtime Pay Formula for a Sixth Working Day
Question details
The user needs to calculate regular and overtime hours accurately when the sixth calendar day is not always the sixth working day due to employee absences.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating weekly employee payroll where overtime applies only after 5 actual working days have been completed, rather than strictly on Saturday.
- Observed behavior
- The goal is to automatically classify weekend hours as regular time if a weekday was missed, or as full overtime if all five prior weekdays were worked.
Ensure your timesheet is structured with clear columns for Start Time (e.g., Column B), End Time (e.g., Column C), and Break Hours (e.g., Column D), with times properly formatted.
Use COUNTIF and IF Formulas to Determine Dynamic Working Days
Apply logical formulas to automatically count completed working days and calculate regular versus overtime hours accordingly, ignoring blank days.
By combining IF and COUNTIF functions, you can instruct Excel to check how many days have been worked so far in a given week. If the count exceeds five, the current day is treated entirely as overtime.
This setup assumes that a blank start-time cell indicates a non-working day. It converts the time difference into decimal hours by multiplying by 24 and subtracts unpaid breaks.
Click on cell E3 (or your designated Regular Hours cell). Type the formula: =IF(COUNTIF($B$3:B3,">0:00")>5,0,MIN((C3-B3)*24-D3,8)). This counts the days worked. If the count is greater than 5, regular hours are 0; otherwise, it caps regular daily hours at 8.
Click on cell F3 (or your designated Overtime Hours cell). Type the formula: =IF(COUNTIF($B$3:B3,">0:00")>5,(C3-B3)*24-D3,MAX(0,(C3-B3)*24-8-D3)). This assigns all worked hours to overtime if it is the 6th working day, or only the hours exceeding 8 if it is a standard workday.
Select both cells E3 and F3. Click and drag the fill handle (the small square at the bottom-right corner of the selection) down to apply these formulas to the remaining rows for that employee's week.

Easily Calculate Payroll Formulas with WPS Spreadsheet
WPS Office Spreadsheet provides full support for complex logical and time calculations, making it simple to process employee timesheets, handle absences, and track overtime hours flawlessly.
- 1. Open Your Timesheet: Launch WPS Spreadsheet and open your existing payroll or timesheet document.
- 2. Input the Formulas: Select the target cell for Regular Hours and input the IF/COUNTIF formula exactly as you would in Excel.
- 3. Drag to Fill: Use the intuitive drag-and-drop fill handle to calculate the entire week's pay instantly across all rows.

Frequently Asked Questions
Why does my Excel time formula return an error or unexpected decimal?
Excel stores time as a fraction of a 24-hour day (e.g., 12 hours is stored as 0.5). To convert time differences into standard decimal hours for payroll calculations, you must multiply the result by 24, as seen in the `(C3-B3)*24` formula.
How do I account for a 30-minute unpaid lunch break in the formula?
You can subtract the break duration as a decimal from the total hours worked. If column D contains the break in decimal format (e.g., 0.5 for 30 minutes), simply subtract D3 directly from the total hours calculated in the formula.
Can I automatically highlight rows that represent the 6th working day or overtime?
Yes. You can use Conditional Formatting with a custom formula. Go to Conditional Formatting > New Rule > Use a formula, and enter `=COUNTIF($B$3:$B3,">0:00")>5`. Choose a highlight color, and it will automatically mark the row when the 6th working day condition is met.




