Calculation Issues

Excel Formula to Split Overnight Shift Hours Across Friday and Saturday

Rana GarciaRana Garcia Dec 2, 2026 868 views

Question details

Calculate the hours worked on each calendar day when a Friday night shift continues into Saturday.

Split Overnight Shift Hours Across Friday and Saturday in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the shift

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.

2
List the dates

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.

3
Calculate daily hours

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.

4
Check the allocation

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.

Calculate the shift hours that overlap each calendar date
Use complete date-time values: The end date-time must be later than the start date-time. This calculation reports elapsed hours and does not automatically deduct unpaid breaks.
Calculate shift hours in WPS

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. 1. Open your schedule: Open WPS Spreadsheet and use Open to select your scheduling workbook.
  2. 2. Enter shift date-times: Enter the full shift start in B2 and the full shift end in C2, including their respective dates.
  3. 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. 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.
Split shift hours at midnight, including across scheduling blocksOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and formatting controlsWork with scheduling sheets in a free office suite
microsoft office alternative - wps office

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.