Abhilash Dasari
Abhilash Dasari

Reputation: 31

How to convert time taken by a command into seconds or minutes in excel?

I have run several commands and noted time taken by a command?

I got output like this in an excel column

126m52.091

136m14.472s

152m25.196s

65m45.490s

how can i convert this mixture of minutes and seconds into seconds in excel?

Results should be like this

7612.091

8174.472

...

Having an excel formula will really help me.

Thanks in advance

Upvotes: 0

Views: 53

Answers (1)

Gary's Student
Gary's Student

Reputation: 96791

With data in A1, use:

=TIMEVALUE("00:" & SUBSTITUTE(SUBSTITUTE(A1,"s",""),"m",":"))*60*60*24

enter image description here

NOTE:

  1. the formula discards the s if it is present.
  2. the formula creates a time-string like: 00:136:14.472
  3. converts into a true Excel time (with TIMEVALUE)
  4. converts the time to seconds

Upvotes: 3

Related Questions