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