Format and convert hours to Minutes

samitnair

Board Regular
Joined
Jul 5, 2010
Messages
155
Hello

I have a column A1 (Time) which has the following data and since it does not have similar formatting I am finding it difficult to convert it into minutes. Any help would be appreciated.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Time[/TD]
[TD]Minutes[/TD]
[/TR]
[TR]
[TD]1d 3h 42m[/TD]
[TD]1662[/TD]
[/TR]
[TR]
[TD]18h 38m [/TD]
[TD]1118[/TD]
[/TR]
[TR]
[TD]34m [/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD]7h 5m [/TD]
[TD]425[/TD]
[/TR]
</tbody>[/TABLE]

Regards
Samit Nair
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
In column A .. is ONE DAY

1d or 1d 0h 0m

Does column A contain TEXT or time formatted values ?
 
Last edited:
Upvote 0
Code:
=ROUND(1440*(IFERROR(LEFT(A2,FIND("d",A2)-1),0)
 + IF(ISNUMBER(SEARCH("h",A2)),
   SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(IFERROR(MID(A2,SEARCH("d",A2)+1,LEN(A2)),A2),"h",":"),"m","")," ",""),
   "0:" & SUBSTITUTE(IFERROR(MID(A2,SEARCH("d",A2)+1,LEN(A2)),A2),"m",""))), 0)

Also test with:
23d
12h
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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