converting text to time

Keyrw01

New Member
Joined
Sep 29, 2018
Messages
5
Good Morning

I am looking for a little help if possible.

I have data that needscoverting to an hh:mm:as format.

the data I am getting is in the following formats and need it all changing to same format as above.

22s
22m 22s
2h 22m 22s

any help would be much apreciated
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]22s[/TD]
[TD]
00:00:22​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]22m 22s[/TD]
[TD]
00:22:22​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]2h 22m 22s[/TD]
[TD]
02:22:22​
[/TD]
[/TR]
</tbody>[/TABLE]


B1=
TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h",""),"m",""),"s","")," ","")+0,"00\:00\:00")+0 copy down

Custom format column B hh:mm:ss
 
Upvote 0
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]22s[/TD]
[TD]
00:00:22​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]22m 22s[/TD]
[TD]
00:22:22​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]2h 22m 22s[/TD]
[TD]
02:22:22​
[/TD]
[/TR]
</tbody>[/TABLE]


B1=
TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h",""),"m",""),"s","")," ","")+0,"00\:00\:00")+0 copy down

Custom format column B hh:mm:ss

First of all thank you very much for the reply.

I have tried the formula that you have provided but I get the error stating 'There's a problem with this formula'
 
Upvote 0
Can you post your file ?


[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]22s[/TD]
[TD]
00:00:22​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]22m 22s[/TD]
[TD]
00:22:22​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]2h 22m 22s[/TD]
[TD]
02:22:22​
[/TD]
[/TR]
</tbody>[/TABLE]


B1=
TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"h",""),"m",""),"s","")," ","")+0,"00\:00\:00")+0 copy down

Custom format column B hh:mm:ss

the new issue that I am having is that if there is a single number of hours minutes and seconds it will not bring it out correctly.

an example would be 1h 1m 1s. this would be brought back as 00:01:11.
any help would be brilliant
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top