jtedmonson42
New Member
- Joined
- Jan 22, 2017
- Messages
- 23
I've looked around and have tried other solutions I've seen posted for similar questions but none have worked completely.
This is a sample of the data.
Formula for day hours currently is:
=MAX(,MIN(D2,IF(B2<A2,1,)+B2)-MAX(A2,C2))
Night hours:
=E2-F2
It appears to work in all day shift start scenarios but the night shift starts that overlap into day time hours seem to be wrong for a lot of cases. Also, day and night shift start times are not static and vary based on location.
This is a sample of the data.
Formula for day hours currently is:
=MAX(,MIN(D2,IF(B2<A2,1,)+B2)-MAX(A2,C2))
Night hours:
=E2-F2
It appears to work in all day shift start scenarios but the night shift starts that overlap into day time hours seem to be wrong for a lot of cases. Also, day and night shift start times are not static and vary based on location.
start time | end time | siteDayStart | SiteNightStart | shiftLength | dayHours | nightHours |
8:30 | 19:00 | 4:30 | 16:30 | 10:30 | 8:00 | 2:30 |
8:30 | 19:00 | 4:30 | 16:30 | 10:30 | 8:00 | 2:30 |
19:30 | 6:00 | 4:30 | 16:30 | 10:30 | 0:00 | 10:30 |
8:30 | 19:00 | 4:30 | 16:30 | 10:30 | 8:00 | 2:30 |
22:30 | 9:00 | 4:30 | 16:30 | 10:30 | 0:00 | 10:30 |
8:30 | 19:00 | 4:30 | 16:30 | 10:30 | 8:00 | 2:30 |
18:30 | 5:00 | 4:30 | 16:30 | 10:30 | 0:00 | 10:30 |