Converting text time to HH:MM format

jwpickett

New Member
Joined
Jan 19, 2005
Messages
36
I've got a data field that is represented in text format as XX hrs. XX mins. where the hours can be anywhere from 0 hrs to 120 hrs and the minutes from 1 min. to 59 min.

I've tried using TIME(LEFT(a2,2),MID(a2,FIND("min",a2)-3,2),0) but if more than 24 hrs. it won't convert correctly. For example, 73 hrs. 08 mins. converts to 01:08 but should, be reflected as 73:08.

Any ideas on how I can resolve this?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try this:
Excel Workbook
AB
178 hrs. 08 mins78:08
250 hrs. 56 mins50:56
3112 hrs. 35 mins112:35
Sheet1
Excel 2010
Cell Formulas
RangeFormula
B1=SUBSTITUTE(LEFT(A1,FIND("mins",A1)-1)," hrs. ",":")+0
 
Upvote 0

Forum statistics

Threads
1,216,742
Messages
6,132,453
Members
449,729
Latest member
davelevnt

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