joe
joe

Reputation: 1473

How to convert a decimal number to numbers in days, hours, and min in Excel

I have a simple cell A2 (48.48333333). I want to convert this number to number of days, numbers of hours, and number of minutes. I expect to see 2 days, and 30 minutes (conversion note: numbers after the decimal (.) would be converted as follow: .50 = 30 minutes, .25 = 15 minutes, .75 = 45 minutes) in this example, .48333333 would be 30 minutes).

Here is my attempts so far but the result is not what I expected.

=INT(A2) & " Days " & INT(MOD(A2, INT(A2))*24) & " Hours and " & MINUTE(A2) & " Minutes"
=TEXT(A2, "d \d, h\hr, m \m")

Is there a link or method in Excel that I can convert A2 cell into days, hours, and minutes?

Upvotes: 0

Views: 2691

Answers (3)

Cliff Williams
Cliff Williams

Reputation: 33

OK I know this is old, but if someone found this looking for the answer as I did. Here is what you can do.

If you have decimal value in days. i.e 52.85385614 Which is: 52 days, 20 hours, 29 minutes, 33.171 seconds, you need to use a formula to format it. (value in cell B7, formula in cell C7)

=CONCAT(INT(B7),".",TEXT(B7-TRUNC(B7),"hh:mm:ss.000"))

This will produce a value of: 52.20:29:33.171

Upvotes: 0

Terry W
Terry W

Reputation: 3277

This will do the job ONLY if the total hour is less than 768 (or 32 days) as being pointed out by @ForwardEd:

=TEXT(A1/24,"d\d h\h m\m")

Demo

Upvotes: 0

Scott Craner
Scott Craner

Reputation: 152660

Use:

=INT(A2/24) & "d " & TEXT(A2/24,"h\h m\m")

enter image description here

Upvotes: 1

Related Questions