Excel Formula to Split Overnight Shift Hours Across Friday and Saturday
Question details
Calculate the hours worked on each calendar day when a Friday night shift continues into Saturday.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An overnight shift crosses midnight and may also cross the boundary of a three-week scheduling block.
- Observed behavior
- A calculation based only on weekday markers can assign the entire shift to Friday rather than splitting it at midnight.
Enter the shift start and end as full Excel date-time values, including Saturday's date for the end. Make sure the schedule includes a row for each calendar date that needs hours assigned, including dates in the next block.
Calculate the shift hours that overlap each calendar date
Use actual dates and times to allocate hours at midnight, including across scheduling-block boundaries.
The formula calculates the overlap between the shift and the 24-hour period beginning on the date in column D. It returns decimal hours, not an Excel time value.
In B2, enter the start date and time; in C2, enter the end date and time. For example, use 1/2/2026 8:00 PM and 1/3/2026 7:15 AM.
Enter the Friday date in D2 and the Saturday date in D3. Use actual date values without time components, even if Saturday belongs to the next scheduling block.
In E2, enter =MAX(0,MIN($C$2,D2+1)-MAX($B$2,D2))*24 and fill the formula down through E3. Set the results to Number format using Home > Number.
For the example shift, verify that E2 shows 4 hours for Friday and E3 shows 7.25 hours for Saturday. Include both results in the appropriate scheduling-block totals.

Split Overnight Shift Hours in WPS Spreadsheet
Use date-time values and a daily overlap formula in WPS Spreadsheet to assign an overnight shift to the correct calendar days.
- 1. Open your schedule: Open WPS Spreadsheet and use Open to select your scheduling workbook.
- 2. Enter shift date-times: Enter the full shift start in B2 and the full shift end in C2, including their respective dates.
- 3. Add calendar dates: Enter the dates to calculate in D2 and D3, including the next block's date if the shift crosses a block boundary.
- 4. Calculate hours: In E2, enter =MAX(0,MIN($C$2,D2+1)-MAX($B$2,D2))*24, fill it down, and format the results as numbers.

Frequently Asked Questions
How many hours belong to each day for an 8:00 PM to 7:15 AM shift?
If the shift starts Friday and ends Saturday, 4 hours fall on Friday and 7.25 hours fall on Saturday. Enter both dates and times in the formula to calculate the split.
What happens if Saturday is in the next three-week block?
Include Saturday's actual date in the next block and calculate its overlap with the same shift start and end date-times. Add the Friday and Saturday results to their respective block totals.
Why does my result show a time instead of decimal hours?
The formula multiplies the date-time difference by 24 to return decimal hours. Select the result cells and choose a Number format from Home > Number.
Can I calculate the split using weekday codes alone?
Weekday codes such as F and S can represent a fixed pattern, but they do not establish the actual midnight or scheduling-block boundary. Use full start and end date-times when shifts can vary.
Does the formula subtract an unpaid break?
No. It calculates elapsed time within each calendar day. Subtract any unpaid break from the day or days on which the break occurred.




