SHIFT A
DAY
Adds 24h to A end if overnight
SHIFT B
DAY
Adds 24h to B end if overnight
A START (HH:MM)
A-S
24-hour time
A END (HH:MM)
A-E
If overnight, end is next day
B START (HH:MM)
B-S
24-hour time
B END (HH:MM)
B-E
If overnight, end is next day
WORKING
—
—
—
—
—
OVERLAP
READY
—
PAGE 1/2
SHIFT A
DAY
Adds 24h to A end if overnight
SHIFT B
DAY
Adds 24h to B end if overnight
A START (HH:MM)
A-S
24-hour time
A END (HH:MM)
A-E
If overnight, end is next day
B START (HH:MM)
B-S
24-hour time
B END (HH:MM)
B-E
If overnight, end is next day
WORKING
—
—
—
—
—
OVERLAP
READY
—
PAGE 1/2
IDEA
Overlap is the time both shifts run
If no overlap, answer is 0
Works with overnight shifts
CONVERT TO MINUTES
mins = 60×HH + MM
Overnight adds 1440 to END
OVERLAP FORMULA
start = max(Astart, Bstart)
end = min(Aend, Bend)
overlap = max(0, end−start)
WORKED EXAMPLE
A: 08:00–16:00
B: 12:00–20:30
start=max(480,720)=720
end=min(960,1230)=960
overlap=240m = 4h 0m
OVERNIGHT TIP
If a shift ends after midnight
tick OVERNIGHT for that shift
end = end + 1440
CHECKS
If end before start, tick overnight
If still wrong, check times
Answer clamps at 0
PAGE 2/2