Time conversion

datastudent

New Member
Joined
Sep 7, 2021
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have this data:

1h 12m 5s
15m 3s
30m
25s

I want to convert it into time format so I can add more formula on it.
My result should be:

1:12:05
0:15:03
0:30:00
0:00:25


Thank you :)
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
A brute force option
+Fluff 1.xlsm
AB
1
21h 12m 5s01:12:05
315m 3s00:15:03
430m00:30:00
525s00:00:25
Main
Cell Formulas
RangeFormula
B2:B5B2=IFERROR(LEFT(A2,FIND("h",A2)-1)/24,0)+IFERROR(MID(A2,FIND("m",A2)-2,2)/1440,0)+IFERROR(MID(A2,FIND("s",A2)-2,2)/86400,0)
 
Upvote 0
Hi @Fluff ,
I tried the formula but I'm having issues with the single digit in minutes like 9m 9s I get 00:00:09. I tried to play with your formula but I still couldn't get it :(
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0
Glad you sorted it & thanks for the feedback.
Sorry, I actually didn't get it. I t thought I did but I just encountered a different issue so now I'm back to the same problem which is the single digit in in minutes :(
 
Upvote 0
How about
Excel Formula:
=IFERROR(LEFT(A2,FIND("h",A2)-1)/24,0)+IFERROR(MID(" "&A2,FIND("m"," "&A2)-2,2)/1440,0)+IFERROR(MID(A2,FIND("s",A2)-2,2)/86400,0)
 
Upvote 0
Solution
How about
Excel Formula:
=IFERROR(LEFT(A2,FIND("h",A2)-1)/24,0)+IFERROR(MID(" "&A2,FIND("m"," "&A2)-2,2)/1440,0)+IFERROR(MID(A2,FIND("s",A2)-2,2)/86400,0)
YES! It works. Thank you so much. You're the best <3
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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