Spreadsheet: 849787d1700172765-interval-staffing-formula-not-working-correctly-when-shifts-cross-midnight-interval-template
Sheet: Data

 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | In time | Out Time | Cross Midnight?
 |  |  |  | Paste Here-> |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 21:00:00 | 2024-01-01 09:00:00 | 12 | 2023-12-31 21:00:00 | 2024-01-01 09:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 06:00:00 | 2023-12-31 18:00:00 | 12 | 2023-12-31 06:00:00 | 2023-12-31 18:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 20:00:00 | 2024-01-01 09:00:00 | 13 | 2023-12-31 20:00:00 | 2024-01-01 09:00:00 | 13
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 06:00:00 | 2023-12-31 18:00:00 | 12 | 2023-12-31 06:00:00 | 2023-12-31 18:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 14:00:00 | 2024-01-01 02:00:00 | 12 | 2023-12-31 14:00:00 | 2024-01-01 02:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 20:00:00 | 2024-01-01 08:00:00 | 12 | 2023-12-31 20:00:00 | 2024-01-01 08:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 05:00:00 | 2023-12-31 17:00:00 | 12 | 2023-12-31 05:00:00 | 2023-12-31 17:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 20:00:00 | 2024-01-01 08:00:00 | 12 | 2023-12-31 20:00:00 | 2024-01-01 08:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 20:00:00 | 2024-01-01 08:00:00 | 12 | 2023-12-31 20:00:00 | 2024-01-01 08:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 06:00:00 | 2023-12-31 18:00:00 | 12 | 2023-12-31 06:00:00 | 2023-12-31 18:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 16:00:00 | 8 | 2023-12-31 08:00:00 | 2023-12-31 16:00:00 | 8
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 10:00:00 | 2023-12-31 22:00:00 | 12 | 2023-12-31 10:00:00 | 2023-12-31 22:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12 | 2023-12-31 07:00:00 | 2023-12-31 19:00:00 | 12
 |  |  |  |  |  |  |  | 2023-12-31 00:00:00 |  |  |  | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12 | 2023-12-31 08:00:00 | 2023-12-31 20:00:00 | 12