Thread: time to seconds
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default time to seconds

I assume the following:-

These are not correctly formatted times
They will all be in the format of your examples.


Try this

=(LEFT(A1,FIND("h",A1)-1)*3600)+(MID(A1,FIND(" ",A1)+1,FIND("m",A1)-(FIND("
",A1)+1))*60)+(SUBSTITUTE(MID(A1,FIND(CHAR(7),SUBS TITUTE(A1,"
",CHAR(7),2))+1,999),"s",""))

all one line
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"inungh" wrote:

I have a spreadsheet which contains time information like follwoing
format

0h 15m 35s
7h 1m 5s

and I would like to convert in seconds,

Are there any functions or formula to do this?


Your help is great appreciated,

.