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]
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]