Forum Discussion
Arnaldo_Longart
Jul 06, 2024Copper Contributor
Hours worked to be distributed into day shift, evening shift, and overnight shift
Hi ! I need help please. I'm not sure how to efficiently distribute the hours worked by each worker into the different shift. The information in the spreadsheet is as follow (also see screenshot b...
- Jul 09, 2024
Arnaldo_Longart The following formulas seem to work for the three shifts:
=LET( time_in, $B2, time_out, $C2 + IF($C2 < time_in, 1, 0), shift_start, TIME(6,0,0), shift_end, TIME(18,0,0), MAX( 0, MIN(time_out, shift_end) - MAX(time_in, shift_start) ) + IF( $C2 < time_in, MAX(0, $C2 - shift_start), 0 ) ) =LET( time_in, $B2, time_out, $C2 + IF($C2 < time_in, 1, 0), shift_start, TIME(18,0,0), shift_end, 1, MAX( 0, MIN(time_out, shift_end) - MAX(time_in, shift_start) ) ) =LET( time_in, $B2, time_out, $C2 + IF($C2 < time_in, 1, 0), shift_start, TIME(0,0,0), shift_end, TIME(6,0,0), MAX( 0, MIN(time_out, shift_end) - MAX(time_in, shift_start) ) + IF( $C2 < time_in, MIN($C2, shift_end), 0 ) )
(Spaces are included for readability; they are not required.)
The attached workbook includes notes and more test data.
Arnaldo_Longart
Jul 07, 2024Copper Contributor
Hi,
Thanks, but it is not working.
Here is the screenshot of my spreadsheet after implementing the updates in the formulas.
Please let me know if you any other idea to solve it.
Thanks, Nikolino
Arnaldo
NikolinoDE
Jul 08, 2024Gold Contributor
A file (without sensitive data) as well as information about Excel version, storage medium, etc. would also help.