how to transform the string "dd-hh-mm-ss" into a amount of seconds?

  • Thread starter Thread starter C. Huvelle
  • Start date Start date
C

C. Huvelle

Hi,
I have the following value in a cell: "1-12-55-24" representing 1 day, 12
hours, 55 minutes and 24 seconds. I would like to compute the total number
of seconds.
How to do this in the easiest way?
Thanks
Christian
 
=VALUE(RIGHT(J10;2))+VALUE(LEFT(RIGHT(J10;5);2))*60+VALUE(LEFT(RIGHT(J10;8);2))*60*60+VALUE(LEFT(RIGHT(J10;LEN(J10));LEN(J10)-10+1))*60*60*24

note: j10 should be cell you have your data of course :
 
Hi
try
=(LEFT(A1,FIND("-",A1)-1)+SUBSTITUTE(MID(A1,FIND("-",A1)+1,20),"-",":"))*24*60*60
 
=(LEFT(A1,FIND("-",A1)-1)+SUBSTITUTE(MID(A1,FIND("-",A1)
+1,999),"-",":"))*86400

HTH
Jason
Atlanta, GA
 
Thank a lot to everybody.
Christian

Jason Morin said:
=(LEFT(A1,FIND("-",A1)-1)+SUBSTITUTE(MID(A1,FIND("-",A1)
+1,999),"-",":"))*86400

HTH
Jason
Atlanta, GA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top