Converting duration in NUMBER format to duration in TIME format in Excel.

judejerrysalmon

New Member
Joined
Sep 24, 2016
Messages
6
Dear all,

I have the duration data for more than 40000 rows in the number format. I need a method to convert the same into time format in excel. BY saying number format i mean 1 Hours & 45 minutes has been given as 1.45. I would like to have the same value 1.45 in the TIME format in excel so that i can sum or average the overall values correctly.

Sample data

7.00
30.00
0.30
1.15
2.15
6.30
0.03
2.50



<colgroup><col style="width: 48pt;" width="64">
<tbody>


</tbody>


Thanks,
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the board

The unit time in excel is 1 day, which means that you just have to divide the numbers you have by 24 and format the cell as time.

For ex., write in a cell 24, copy, select the target cells and PasteSpecial->Divide. Format the cells.
 
Upvote 0
try
=TIMEVALUE(LEFT(A1,LEN(A1)-3)&":"&RIGHT(A1,2))
and format cells as time
this assumes its exactly as shown with zeros , ie always 2 decimal places , even if zero ie .00
and not a decimal fraction after the . - as you say .45 is not decimal but 45 mins - so you would never have over .59
 
Last edited:
Upvote 0
try
=TIMEVALUE(LEFT(A1,LEN(A1)-3)&":"&RIGHT(A1,2))
and format cells as time
this assumes its exactly as shown with zeros , ie always 2 decimal places , even if zero ie .00
and not a decimal fraction after the . - as you say .45 is not decimal but 45 mins - so you would never have over .59


Thanks a lot etaf for your effort. You have understood the problem perfectly. BUt, this formula returns correct values fot 35 of 79 instances. It is returning #VALUE error for the remaining.

First column is the raw data and second column is the output after applying the formula.

Duration in number format
Duration in TIME format (h:mm)
0.030:03
0.050:05
0.060:06
0.070:07
0.080:08
0.090:09
0.10#VALUE!
0.110:11
0.120:12
0.130:13
0.140:14
0.150:15
0.160:16
0.17#VALUE!
0.17#VALUE!
0.180:18
0.20#VALUE!
0.210:21
0.220:22
0.230:23
0.240:24
0.250:25
0.260:26
0.270:27
0.30#VALUE!
0.350:35
0.380:38
0.40#VALUE!
0.410:41
0.440:44
0.450:45
0.50#VALUE!
0.550:55
1.00#VALUE!
1.10#VALUE!
1.151:15
1.171:17
1.20#VALUE!
1.261:26
1.30#VALUE!
1.351:35
1.40#VALUE!
1.491:49
1.50#VALUE!
1.521:52
1.551:55
2.00#VALUE!
2.152:15
2.20#VALUE!
2.30#VALUE!
2.50#VALUE!
3.00#VALUE!
3.30#VALUE!
3.453:45
3.50#VALUE!
4.00#VALUE!
4.30#VALUE!
5.00#VALUE!
6.00#VALUE!
6.30#VALUE!
7.00#VALUE!
8.00#VALUE!
9.00#VALUE!
10.00#VALUE!
10.50#VALUE!
12.00#VALUE!
14.00#VALUE!
16.00#VALUE!
18.00#VALUE!
20.00#VALUE!
21.00#VALUE!
24.00#VALUE!
28.00#VALUE!
30.00#VALUE!
32.00#VALUE!
40.00#VALUE!
44.00#VALUE!
190.00#VALUE!

<tbody>
</tbody><colgroup><col><col></colgroup>


Thanks,
 
Upvote 0
I see, with 0.25 you don't mean 0.25 of an hour, you mean 0:25 in excel time.

In that case try:

=DOLLARDE(A1,60)/24

and format the cell as time.
 
Last edited:
Upvote 0
strange, not sure why - but pgc01 has replied
and i have learnt a new function from pgc01
thanks

you may need to format as [h]:mm
 
Last edited:
Upvote 0
I see, with 0.25 you don't mean 0.25 of an hour, you mean 0:25 in excel time.

In that case try:

=DOLLARDE(A1,60)/24

and format the cell as time.

Thanks for your effort pgc01. In my data, the duration column is in NUMBER format (thats the way it has been downloaded). So,if it is 0.25, it means 25 minutes. If it is 1.45, it means 1 hour and 45 minutes. The colmun containing these duration values are in NUMBER format and not in TIME format. 1.45 in my data is not the decimal equivalent as well. 1.45 in my data is literally the exact duration, unfortunately displayed in number format.

Thanks
 
Upvote 0
strange, not sure why - but pgc01 has replied
and i have learnt a new function from pgc01
thanks

you may need to format as [h]:mm


Thanks etaf. I have formatted the output column in [h]:mm format only. As your formula works for 35 instances out of the 79, appreciate if you can tweak the same if possible. I am pretty new when it comes to formulas that requires higher order customization. Thanks in advance.
 
Upvote 0
if the cells is in number format
then
7.00
should display as 7
unless you have formatted for 2 decimals

because it was left justified , then text

what happened using DOLLARDE(A1,60)/24
should work for numbers and text
 
Last edited:
Upvote 0
I see, with 0.25 you don't mean 0.25 of an hour, you mean 0:25 in excel time.

In that case try:

=DOLLARDE(A1,60)/24

and format the cell as time.

Thanks pgc01... This formula works well for values upto 24.. For duration 24 and above, it is returning wrong values.. For 24 it is returning 0:00, for 50 hours, it's returning 2:00.. Any possibilities of tweaking so that this returns correct values for 24 and above as well?. Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

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