Best way to Convert time stored as text, at different lengths to a standard time unit?

AYouQueTai

Board Regular
Joined
Sep 14, 2019
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hello,

Wondering how you all would go about this. I have been mucking around with this all afternoon trying to go from LEFT to RIGHT and using LEN to come up with a formula that works for all of the following entries.
How would you standardize this? There are no seconds when there are hours. the minutes go from left to right depending on if there are hours. If there are 1-9 units it is a single digit rather than always having 2, so it moves the hour, minute or second identifier. Is there an easy way to do this?

Book2
AB
1Idling Time(The Goal) Idle Time
25m 8s00:05:08
35m 11s00:05:11
414m 33s00:14:33
51h 2m01:02:00
610h 5m10:05:00
712h 15m12:15:00
Sheet1


Thanks,
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Ignore my post #10
The approach nearly worked. Replace it with

--IF(ISERROR(FIND("h",A2)),TEXTJOIN(":",,TEXTSPLIT("0h"&A2,{"h","m ","s"})),TEXTJOIN(":",,TEXTSPLIT(A2,{"h","m"})))
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,082
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