Home > front end >  Google Sheet - convert Hours & minute to seconds
Google Sheet - convert Hours & minute to seconds

Time:01-08

Need to convert Hours & minutes to seconds.

Ex : 5h 30m -> 19800
3h 15m -> 11700

Tried to use Formatting options & the SECOND() function. But it's not working.

CodePudding user response:

if you have 5:30 you can do this:

=TEXT(A7, "[ss]")*1

enter image description here

if you have no idea use:

=INDEX(IFERROR(1/(1/TEXT(REGEXREPLACE(A7:A10&"", 
 "(\d )h ?(\d )m", "$1:$2")*1, "[ss]"))))

enter image description here

CodePudding user response:

Try:

enter image description here

Formula in B1:

=INDEX(IF(A1:A<>"",--REGEXREPLACE(A1:A,"(\d )h  (\d )m","$1:$2"),""))

Custom numberformat in B:B is [ss].

  •  Tags:  
  • Related