Good afternoon,
I am making a simple task very difficult and have run out of ideas so hope someone can help.
From researching posts on the forum I have managed to get this working but with problems (highlighted green works red does not)
Could anyone please advise me how to change the formulas to account for the mistakes I am seeing below (I can see the problem when Col A > Col B but I am unable to correct it):
Any help or advice would be greatly appreciated.
Many thanks for taking the time to look
Sara
I am making a simple task very difficult and have run out of ideas so hope someone can help.
From researching posts on the forum I have managed to get this working but with problems (highlighted green works red does not)
Could anyone please advise me how to change the formulas to account for the mistakes I am seeing below (I can see the problem when Col A > Col B but I am unable to correct it):
Test data.xlsx | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | 06:00:00 | |||||||
2 | 16:00:00 | |||||||
3 | 22:00:00 | |||||||
4 | 00:00:00 | |||||||
5 | ||||||||
6 | ||||||||
7 | 06:00-16:00 | 16:00-22:00 | 22:00-06:00 | |||||
8 | Start | End | Shift 1 10hrs | Shift 2 6hrs | Shift 3 8hrs | TOTAL | ||
9 | 18:30 | 2:15 | 02:15:00 | 03:30:00 | 02:00:00 | 07:45:00 | ||
10 | 3:50 | 14:30 | 08:30:00 | 00:00:00 | 00:00:00 | 10:40:00 | ||
11 | 4:00 | 14:54 | 08:54:00 | 00:00:00 | 00:00:00 | 10:54:00 | ||
12 | 4:15 | 16:56 | 10:00:00 | 00:56:00 | 00:00:00 | 12:41:00 | ||
13 | 5:25 | 15:33 | 09:33:00 | 00:00:00 | 00:00:00 | 10:08:00 | ||
14 | 7:43 | 15:12 | 07:29:00 | 00:00:00 | 00:00:00 | 07:29:00 | ||
15 | 11:46 | 22:56 | 04:14:00 | 06:00:00 | 00:56:00 | 11:10:00 | ||
16 | 11:43 | 19:34 | 04:17:00 | 03:34:00 | 00:00:00 | 07:51:00 | ||
17 | 11:49 | 22:27 | 04:11:00 | 06:00:00 | 00:27:00 | 10:38:00 | ||
18 | 11:44 | 22:18 | 04:16:00 | 06:00:00 | 00:18:00 | 10:34:00 | ||
19 | 11:31 | 22:11 | 04:29:00 | 06:00:00 | 00:11:00 | 10:40:00 | ||
20 | 9:45 | 16:30 | 06:15:00 | 00:30:00 | 00:00:00 | 06:45:00 | ||
21 | 16:05 | 0:11 | 00:11:00 | 05:55:00 | 02:00:00 | 08:06:00 | ||
22 | 15:47 | 1:47 | 02:00:00 | 06:00:00 | 02:00:00 | 10:00:00 | ||
23 | 16:44 | 23:40 | 00:00:00 | 05:16:00 | 01:40:00 | 06:56:00 | ||
24 | 6:11 | 17:53 | 09:49:00 | 01:53:00 | 00:00:00 | 11:42:00 | ||
Sheet4 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C9:C24 | C9 | =IF(COUNT($A9:$B9)=2,MAX(0,MIN($A$2,$B9+($B9<$A9))-MAX($A9,$A$1))+MAX(0,MIN($A$2+1,$B9+($B9<$A9))-1),"") |
D9:D24 | D9 | =IF(COUNT($A9:$B9)=2,MAX(0,MIN($A$3,$B9+($B9<$A9))-MAX($A9,$A$2)),"") |
E9:E24 | E9 | =IF(COUNT($A9:$B9)=2,MAX(0,MIN($A$4,$B9+($B9<$A9))-MAX($A9,$A$3)),"") |
F9:F24 | F9 | =IF(COUNT($A9:$B9)=2,$B9-$A9+($B9<$A9),"") |
Any help or advice would be greatly appreciated.
Many thanks for taking the time to look
Sara