Google sheets duration to seconds
I have found this solution:
let the cell A1 filled with duration like 1:22:33
, than formula
=HOUR(A1)*3600+MINUTE(A1)*60+SECOND(A1)
will do the trick.
For example, 1:01:01
-> 3661
To convert duration to an integer expressing the number of seconds, use a formula such as
=value(A1*24*3600)
Time values are recorded so that 1 is one day. Multiplying by 24 (hours/day) and 3600 (seconds/hour) converts that to seconds. Then value
makes it a number rather than duration.
Old answer, about formatting only.
You don't need any formulas to format duration as the number of seconds.
- Go to Format > Number > More formats > More data and time formats
- Delete the pre-filled format fields and add "Elapsed seconds" from the dropdown menu.