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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
A
B
1
22s
00:00:22​
2
22m 22s
00:22:22​
3
2h 22m 22s
02:22:22​

<tbody>
</tbody>


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
A
B
1
22s
00:00:22​
2
22m 22s
00:22:22​
3
2h 22m 22s
02:22:22​

<tbody>
</tbody>


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 ?


A
B
1
22s
00:00:22​
2
22m 22s
00:22:22​
3
2h 22m 22s
02:22:22​

<tbody>
</tbody>


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,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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