Error in Overlapping Time

meowbhow

New Member
Joined
May 31, 2018
Messages
21
Marcelo, please check the formula if it has some issue = SUM(IF(A$2:A$9999=A312,IF(1-((B312>C$2:C$9999)+(B$2:B$9999>C312)),IF(ROW(A$2:A$9999)>ROW(A312),IF(C$2:C$9999>C312,C312,C$2:C$9999)-IF(B$2:B$9999>B312,B$2:B$9999,B312)))))

Result should be 1 hour instead of 17:37 hours

[TABLE="width: 695"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Guzgi (USF) (Wateen OFS) Khuzdar[/TD]
[TD="align: right"]2017-12-04 22:19:28
[/TD]
[TD] 12/04/2017 23:59:59
[/TD]
[TD]17:37:20
[/TD]
[/TR]
[TR]
[TD]Guzgi (USF) (Wateen OFS) Khuzdar[/TD]
[TD="align: right"]2017-12-04 22:19:35
[/TD]
[TD] 12/04/2017 23:59:59
[/TD]
[TD]15:56:49[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I don't understand your dates. The formula worked perfectly for me with proper dates as dd/mm/yyyy hh:mm:ss (April 12)


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Name​
[/td][td]
StartDate​
[/td][td]
EndDate​
[/td][td]
Result​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
Guzgi (USF) (Wateen OFS) Khuzdar​
[/td][td]
12/04/2017 22:19:28​
[/td][td]
12/04/2017 23:59:59​
[/td][td]
01:40:24​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
Guzgi (USF) (Wateen OFS) Khuzdar​
[/td][td]
12/04/2017 22:19:35​
[/td][td]
12/04/2017 23:59:59​
[/td][td]
00:00:00​
[/td][/tr]
[/table]


Array formula in D2
=SUM(IF(A$2:A$9=A2,IF(ROW(A$2:A$9)>ROW(A2),IF(1-(B$2:B$9>C2)+(B2>C$2:C$9),IF(C2>C$2:C$9,C$2:C$9,C2)-IF(B2>B$2:B$9,B2,B$2:B$9)))))
Ctrl+Shift+Enter

Adjust the dates and the formula should work.

M.
 
Upvote 0
How about this data ? I have adjusted the date but this is the issue i am facing now.
[TABLE="width: 594"]
<colgroup><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:16:48[/TD]
[TD="align: right"]2017-12-19 00:29:48[/TD]
[TD="align: right"]2:35:56[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:17:18[/TD]
[TD="align: right"]2017-12-18 23:37:26[/TD]
[TD="align: right"]0:20:08[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:40:35[/TD]
[TD="align: right"]2017-12-19 00:01:26[/TD]
[TD="align: right"]0:41:42[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-19 00:55:28[/TD]
[TD="align: right"]2017-12-19 08:00:23[/TD]
[TD="align: right"]6:43:25[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-19 04:09:04[/TD]
[TD="align: right"]2017-12-19 07:54:55[/TD]
[TD="align: right"]0:00:00[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-19 03:24:50[/TD]
[TD="align: right"]2017-12-19 04:08:20[/TD]
[TD="align: right"]0:00:00[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:16:48[/TD]
[TD="align: right"]2017-12-19 00:29:48[/TD]
[TD="align: right"]0:41:57[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-19 00:29:58[/TD]
[TD="align: right"]2017-12-19 00:54:33[/TD]
[TD="align: right"]0:21:04[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-19 02:36:27[/TD]
[TD="align: right"]2017-12-19 02:59:35[/TD]
[TD="align: right"]0:00:00[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar
[/TD]
[TD="align: right"]2017-12-19 02:11:10
[/TD]
[TD="align: right"]2017-12-19 02:34:15
[/TD]
[TD="align: right"]0:00:00
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
All the data is in ascending order now, but still same problem.
[TABLE="width: 594"]
<colgroup><col><col span="2"><col></colgroup><tbody>[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:16:48[/TD]
[TD="align: right"]2017-12-19 00:29:48[/TD]
[TD="align: right"]2:35:56[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:16:48[/TD]
[TD="align: right"]2017-12-19 00:29:48[/TD]
[TD="align: right"]1:22:56[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:17:18[/TD]
[TD="align: right"]2017-12-18 23:37:26[/TD]
[TD="align: right"]0:00:00[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:40:35[/TD]
[TD="align: right"]2017-12-19 00:01:26[/TD]
[TD="align: right"]0:20:51[/TD]
[/TR]
[TR]
[TD]Pull (USF) Khuzdar[/TD]
[TD="align: right"]2017-12-18 23:40:35[/TD]
[TD="align: right"]2017-12-19 00:01:26[/TD]
[TD="align: right"]0:00:00[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
The formula worked perfectly for me


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Name​
[/TD]
[TD]
Start​
[/TD]
[TD]
End​
[/TD]
[TD]
Result​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
Pull (USF) Khuzdar​
[/TD]
[TD]
2017-12-18 23:16:48​
[/TD]
[TD]
2017-12-19 00:29:48​
[/TD]
[TD]
02:14:50​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
Pull (USF) Khuzdar​
[/TD]
[TD]
2017-12-18 23:16:48​
[/TD]
[TD]
2017-12-19 00:29:48​
[/TD]
[TD]
01:01:50​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
Pull (USF) Khuzdar​
[/TD]
[TD]
2017-12-18 23:17:18​
[/TD]
[TD]
2017-12-18 23:37:26​
[/TD]
[TD]
00:00:00​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
Pull (USF) Khuzdar​
[/TD]
[TD]
2017-12-18 23:40:35​
[/TD]
[TD]
2017-12-19 00:01:26​
[/TD]
[TD]
00:20:51​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
Pull (USF) Khuzdar​
[/TD]
[TD]
2017-12-18 23:40:35​
[/TD]
[TD]
2017-12-19 00:01:26​
[/TD]
[TD]
00:00:00​
[/TD]
[/TR]
</tbody>[/TABLE]


D2
=SUM(IF(A$2:A$11=A2,IF(ROW(A$2:A$11)>ROW(A2),IF(1-(B$2:B$11>C2)+(B2>C$2:C$11),IF(C2>C$2:C$11,C$2:C$11,C2)-IF(B2>B$2:B$11,B2,B$2:B$11)))))
Ctrl+Shift+Enter

Please, enter carefully the formula when doing tests. I've to leave now. Good luck.

M.
 
Upvote 0

Forum statistics

Threads
1,224,974
Messages
6,182,100
Members
453,088
Latest member
Chaoxite

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top