How to convert a numerical figure in to Day:Hour:Minute format by MS Excel?
I would like to convert 85,75 Hours into ..days…hours.. minutes. It is possible to get it through MS Excel
days = int(85.75 / 24)
hours = int((85.75 – (days*24)))
minutes = int((85.75 – (days*24) – (hours)) * 60)
that should do it!
Then, maybe a VBA script to put the values (as strings) together.
2 Responses
Leave a Comment
|
July 24th, 2010 at 1:41 am
days = int(85.75 / 24)
hours = int((85.75 – (days*24)))
minutes = int((85.75 – (days*24) – (hours)) * 60)
that should do it!
Then, maybe a VBA script to put the values (as strings) together.
References :
July 24th, 2010 at 1:52 am
If the 85,75 is just a plain string in a cell and you are wanting to get rid of the comma you can do the following:
Assume 85,75 is in A1 you will need 5 blank cells to the right.
Now in B1 type =FIND(",",A1)
In C1 type =LEFT(A1,LEN(A1)-B1)
In D1 type =RIGHT(A1,LEN(A1)-B1)
In E1 type =CONCATENATE(C1,D1)
In F1 type =VALUE(E1)
While you are in cell F1, Click format/cells/number tab/time and choose what you want.
If you have a long list of cells like A1 you can copy the above 5 formulas down to end of your list.
References :