I have an issue with being able to count time on Excel. I have numerous data that start at various times nad I"m converting all of it to total seconds, so therefore i'm only using seconds. The equation I have is as follows. For the first number in in the series the equation is,=IF(A2>=0,1), then followed by =IF(A3=A2,H2,IF(A3=0,H2+1,IF(A3>=1,A3-A2+H2,H2+1))). But this doesn't work for every case, meaning, I sometimes go from 57,58,59,0,2,3,4. And I can't figure out a equation to represent all, also, Sometimes i have 34,35,37,0,39 where data is lost, and I need to account for that too. So basically i'm just looking for a way to add up all the seconds.

EDIT: also if it's the same second, I need to eb the same as the previous hence the first part of my equation (A3=A2, H2)