Calculate Overtime Pay in Excel by Day, Holiday, and Time Band
Question details
Create an overtime calculator that applies pay rates based on the work date and time.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user needs to calculate overtime pay for weekday, Saturday, Sunday, and public holiday shifts with different time-band rates.
- Observed behavior
- The desired calculator assigns the applicable rate to each part of a shift, including parts that cross midnight.
Gather your holiday dates, hourly overtime rates, and time-band boundaries. Decide which hours qualify as overtime and whether holiday rates take priority over weekend rates.
Calculate pay for shift segments with a rate table
Use this method when rates can change at midnight or during a shift.
This example gives holidays priority over weekdays and weekends. It calculates pay for hours already identified as overtime; it does not determine overtime eligibility or deduct unpaid breaks.
Enter each shift segment on a separate row. Split shifts at midnight, every rate-band boundary, and any unpaid break so each row has one applicable rate.
In Excel, enter actual holiday dates in cells J2:J100. Format the cells as dates and omit any time values.
In columns P:S, enter Day Type, Band Start, Band End, and Hourly Rate. Use Weekday, Saturday, Sunday, or Holiday as the day type. Enter times as Excel time values, with 24:00 as the end of a band that runs to midnight. For each day type, make bands cover the applicable times without overlapping.
In columns A and B, enter the full start and end date and time for each segment. For example, split a shift from 10:00 p.m. to 2:00 a.m. into rows ending and starting at midnight, and split it further if a rate changes during either segment. Each end must be later than its start.
In C2, enter =IF(COUNTIF($J$2:$J$100,INT(A2))>0,"Holiday",IF(WEEKDAY(INT(A2),2)=6,"Saturday",IF(WEEKDAY(INT(A2),2)=7,"Sunday","Weekday"))). This checks the segment's start date against the holiday list before checking the weekday.
In D2, enter =(B2-A2)*24 for hours. In E2, enter =SUMIFS($S$2:$S$100,$P$2:$P$100,C2,$Q$2:$Q$100,"<="&MOD(A2,1),$R$2:$R$100,">"&MOD(A2,1)) to find the rate for the segment's start time. In F2, enter =D2*E2. Copy C2:F2 down and use =SUM(F2:F100) to total the pay.
Compare sample rows with your expected pay, especially holiday and midnight segments. Check that every segment fits wholly within one rate band and that each day type has exactly one matching band for its start time.

Build an overtime rate calculator in WPS Spreadsheet
Use WPS Spreadsheet to enter holiday dates and rate bands, then calculate pay for each shift segment with date, time, and lookup formulas.
- 1. Open a spreadsheet: Open WPS Spreadsheet and create a blank workbook or open your existing Excel workbook.
- 2. Set up dates and rates: Enter holiday dates in J2:J100 and create the day-type, band-start, band-end, and hourly-rate table in columns P:S.
- 3. Enter shift segments: Enter full start and end dates and times in columns A and B, splitting each shift at midnight, rate changes, and unpaid breaks.
- 4. Add formulas and check pay: Enter the day-type, hours, rate, and pay formulas from the solution above in C2:F2, copy them down, and compare sample results with your expected pay.

Frequently Asked Questions
How do I calculate hours for an overnight shift in Excel?
If start and end are time-only values and the shift is shorter than 24 hours, use =MOD(EndTime-StartTime,1)*24. To apply different rates after midnight, enter full dates and times and split the shift into separate rows at midnight.
How does the calculator recognize a public holiday?
Enter holiday dates in J2:J100. The day-type formula uses COUNTIF with INT(A2) to check the segment's start date and assigns Holiday before checking whether it is a Saturday or Sunday.
What if the rate changes halfway through a shift?
Split the shift into separate rows at the rate-change time. Each row must fall within one rate band so the formula can apply the correct hourly rate to all hours in that segment.
Why does the rate formula return zero?
A zero can mean no rate band matched the day type and start time, or that the matching rate is actually zero. Check columns P:S for the correct day type, time values, and complete, nonoverlapping bands.




