Back to articles
IntermediateTime and Date
2010-10-075 min read
#time

Convert Decimal Hours to Time in Excel — Including Totals Over 24 Hours

Functions in this article

Jump to the reference pages for the Excel functions used below.

Browse library
Table of Contents

To convert decimal hours to an Excel duration, divide by 24 and apply the custom number format [h]:mm. With 5.75 in A2, =A2/24 displays 5:45. The same method converts 27.5 hours to 27:30 without losing the full day.

Suppose a work log records hours as decimals, but you need to read them as hours and minutes. The .75 in 5.75 hours means three-quarters of an hour, which is 45 minutes. Dividing by 24 converts the entire amount into Excel's unit of time, a day.

Convert a column of decimal hours

Follow along on the Example sheet in the decimal-hours conversion workbook. It includes the elapsed-time formats and reverse conversions used below.

Keep the original decimal values in column A and put the converted durations in column B. Use Decimal hours in A1 and Duration in B1.

  1. Enter 5.75 in A2, 27.5 in A3, and 1.75 in A4.
  2. Enter this formula in B2 and copy it through B4.
=A2/24
Formula

  1. Select B2:B4 and open Format Cells. On Windows, press Ctrl+1. On Mac, press Command+1.
  2. In the Number settings, select Custom and enter [h]:mm in the format's Type box.
  3. Apply the format.

You should see these results.

Decimal hours in AFormula in BDisplay with [h]:mm
5.75=A2/245:45
27.5=A3/2427:30
1.75=A4/241:45

Before formatting, B2 may show approximately 0.2395833333. That is 5.75 hours expressed as a fraction of a day. The date and time calculation guide explains how Excel stores that value.

Apply the elapsed-time format to column B, where the values have been divided by 24. If you apply it directly to 5.75 in A2, Excel reads that as 5.75 days and displays 138:00.

Keep totals over 24 hours visible

The brackets around h tell Excel to display accumulated hours. Without them, the ordinary h:mm time format wraps the displayed hours after each complete day.

Duration being displayedWith h:mmWith [h]:mm
5.75 hours5:455:45
24 hours0:0024:00
27.5 hours3:3027:30

The underlying value still contains the complete duration even when the display wraps. Microsoft's custom number-format guidelines document [h]:mm for elapsed hours and minutes. Use [h]:mm:ss if your source includes seconds you want to display.

You can add the converted values normally. Enter =B2+B3 in B6 and apply [h]:mm to B6. The result is 33:15, the combined duration of 5.75 and 27.5 hours.

Excel for Mac with B3 selected, showing =A3/24 converting 27.5 hours to 27:30 and the combined duration 33:15 in B6
The elapsed-time format keeps complete days visible in both the individual duration and the total.

The TIME function constructs a clock time from hour, minute, and second inputs. It wraps hour inputs above 23 into a time within a day, so it won't preserve the full elapsed hours in this example. Dividing decimal hours by 24 keeps those complete days in the value.

These formatting steps use desktop Excel. Microsoft's guide to adding and subtracting time notes that Excel for the web can calculate durations over 24 hours but cannot apply a custom number format. Use desktop Excel to set up the elapsed-time display when needed.

Convert a duration back to decimal hours

To reverse the conversion, multiply the numeric Excel duration by 24. In C2, enter this formula and copy down.

=B2*24
Formula

Format column C as General or Number. B2's 5:45 becomes 5.75, and B3's 27:30 becomes 27.5.

This formula expects an Excel time or duration stored in days. If the source cell contains a complete date and time, multiplying it by 24 also multiplies the date portion. For a log with start and end timestamps, first calculate the elapsed duration using the guide to hours between two dates and times.

Convert decimal hours to total minutes

Multiply decimal hours by 60 to get the total number of minutes. For 1.75 hours in A4, enter this in D4.

=A4*60
Formula

The result is 105 minutes. One hour contributes 60 minutes, and the remaining 0.75 hour contributes 45 minutes. The 45-minute portion alone doesn't describe the full duration.

Keep the result formatted as General or Number. If you're starting from the converted duration in B4 instead, multiply by 1440, the number of minutes in a day.

=B4*1440
Formula

That also returns 105. The conversion factor depends on the starting unit, so check the column heading before choosing the formula.

If 6:30 is stored as text

An imported field containing the text 6:30 needs conversion with the TIMEVALUE function before you treat it as a numeric Excel time. For that limited clock-time example in F2, this formula returns 6.5 decimal hours.

=TIMEVALUE(F2)*24
Formula

Format the result as General or Number. If F2 already contains a numeric Excel time, use =F2*24 instead. The text-to-time troubleshooting guide shows how to check the stored type and handle spaces or imported time notation.

That text example is limited to a time within one day. For longer elapsed amounts such as 27.5 hours, keep the numeric hours and use the divide-by-24 calculation from the first section.

Enjoyed this guide?

Join our newsletter to get the latest Excel tips delivered to your inbox.

You can unsubscribe anytime. See our Privacy Policy.

Archived comments

Comments migrated from the previous version of the site. Adding new comments is disabled.

JiriJanuary 12, 2012 at 11:22 AM
How can I convert decimal value bigger than 24 hours? For example, how do I convert 45.5 hours into format 45:30 ???
Gregoryexcelsemipro.comJanuary 13, 2012 at 03:18 AM
That's always a hard one. I had to look it up again here. Essentially you divide the number (45.5) by 24, then change the cell formatting to a custom format [h]:mm and Excel will do the work for you. (Putting the h inside brackets means the time will be cumulative.)
JiriJanuary 13, 2012 at 04:58 AM
Thank you very much indeed! I could not find this detail (the function of the brackets) anywhere.
Luis SerpaSeptember 17, 2012 at 08:44 AM
Hello, I am trying to find a solution for a problem with time calculation. I want to find how many days and hours will a trip last at different speeds (and then add this value to a starting date to otain an ETA, but this is easy). Until now I simply divided the distance by the speed and then by 24, but this works only to distances/speed that led to trip duration inferior to one month. With duration superior to that value the formula only returns values that exceed the 30 days. You can hav an example by dividing 10'000 miles by a speed of 5 knots. Result is 200o hours which is 83,3 days. If I fromat that in a dd"d" hh"h" format it returns 23d 08h. Maybe the problem is only the formatting, but I would like to be able to obtain 83d 08h. How can i do that? Many thanks in advance Luis Serpa
Gregoryexcelsemipro.comSeptember 19, 2012 at 12:19 AM
This will fix your problem. =INT(2000/24)&"d "&TEXT((2000/24)-INT(2000/24),"h") & "h" and give you 83d 8h.
Luis SerpaSeptember 19, 2012 at 07:05 AM
Many thanks.
Luís SerpaNovember 26, 2012 at 08:47 AM
Sorry, only now did I try your solution, but it does not work: the result is text, and it is not possible to do any calculation with it. I'm trying with IF function (IF value > 30 then...) but it seems too heavy a solution. There should be a simpler way. Thanks Luis
Dawn CunninghamNovember 14, 2012 at 04:43 PM
Start time is 07:30 End time is 16:00 Lunch hour is .5 I need the forumla using these time formats for how many hours worked. So far, I have this: =TEXT(B2-A2,"h:mm") Which is working... until I tried to put in the minus .5 for lunch. Thanks so much!
Gregoryexcelsemipro.comNovember 15, 2012 at 03:01 AM
Assume cell A2 = 7:30 and cell B2 = 16:00 then lunch time should be in the same unit of measure. Instead of using decimal hours for lunch, 0.5 hours, you should use the same time format 0:30. Assume that in cell C2 you enter 0:30, then a formula in cell D2 would be =B2-A2-C2 and would result in 8:00. End time minus start time minus lunch duration (in time format h:mm) equals hours worked.
Dawn CunninghamNovember 15, 2012 at 12:52 PM
Hi Gregory... I was not "allowed" to change the .5 and they have kept their formula "hidden" or "locked" somehow. When I did try the :30 it wasn't working anyways. HOWEVER, when I added the "0" in front bazinga! it works! :-D Thank you very much for your help! And "they" will just have to deal with the change! LOL
Dawn CunninghamNovember 15, 2012 at 01:46 PM
Oh, Ok, so what happens when I use this formula my calculation of hours is kept in the time format. So, 8.5 hours shows up as 8:30 and that is not what I am required to have. I am trying to format those specific cells to show the 8.5 but I am not figuring it out yet. If you have anything further to suggest that would be great!!! :-) Just to recap, I need to calculate the amount of hours: A1=Start Time 07:30 B1=End Time 16:00 C1=Lunch is .5 (half an hour) D1=Number of hours worked is: ??.??
Gregoryexcelsemipro.comNovember 15, 2012 at 03:10 PM
D1 = (B1-A1)*24-C1
Dawn CunninghamNovember 15, 2012 at 03:54 PM
THANK YOU !!! WOW, you have just saved me SO much time!
Marcus StavchaskyFebruary 26, 2013 at 10:14 PM
Random question, Can one set up a cell to receive 4 digits and have those digits convert to the hh:mm format after pressing enter? For example, I enter in 1635 and the cell reads 16:35, Or I enter in 0957 and the cell reads 09:57 Thank you for your help. -Stav
Gregoryexcelsemipro.comFebruary 27, 2013 at 12:07 AM
It is possible if you write some VBA code to handle the complexities. I had another reader leave a comment about entering 3 or 4 digits for military time, leaving out the delimiter (:) and calculating the difference between End and Start times. I sent him a spreadsheet with all the calculations that you have to go through to make this work. It's not difficult, just detailed. So advancing that idea one more level by having VBA recognize input for cells in a particular column, and then making a transformation to regular time format is not that difficult. Just detailed and involved. You've given me an idea for a couple of blog posts. Thanks.
Marcus StavchanskyFebruary 27, 2013 at 12:49 AM
Do you mind linking me to your blog if you plan to share a solution using VBA code. I am very interested in learning a solution for my issue.
Gregoryexcelsemipro.comMarch 3, 2013 at 07:05 PM
You can subscribe to my blog on the main page. When I write this post, I'll email you the link.
Jamal RabbaniMarch 28, 2013 at 05:31 PM
I would like to conver 2:31 (2 hrs 31 minutes) into minutes and then divide by number of calls to find average time per call. How do i convert number to minutes?
Gregoryexcelsemipro.comMarch 30, 2013 at 06:16 PM
Assume that 2:31 is in cell A1 and the number of calls is in cell B1, which the value is 10 for this example. The formula you want is: =(A1*24*60)/B1 and make sure you cell formatting is General. The formula returns 15.1 minutes per call. The 2:31 is multiplied by 24 hours/day and 60 minutes/hour to convert to 151 minutes. You can also use 1440, which is the number of minutes in a day (24 X 60). Then you simply divide by number of calls to get minutes per call.
AdolfoApril 15, 2013 at 06:56 PM
Guys, I used your procedure for Calculating Hours Between 2 Dates and Times... easy... Now I'm using your Convert Decimal Hours to Time in Excel, but I have some ranges with more than 24 hours, so as you mentioned, it doesn't works properly... there is a way to make it work with more than 24 hours?
Gregoryexcelsemipro.comApril 16, 2013 at 02:16 AM
Change your cell formatting to add a square bracket [] around the h in the time format. Here's how: In the Format Cells dialog box (CTRL+1 on a PC and CMD+1 on a Mac) click the Number tab, in the Category box select Custom, then in the Type: box enter [h]:mm and the hour will accumulate past 24 hours.
adolfoApril 16, 2013 at 01:15 PM
You are the man Greg... works perfectly.. THX!!!
DebApril 16, 2013 at 02:35 AM
Hi Gregory, I am learning Excel and need help on calculating the total time (hours and minutes) worked in a day. For example: Start time was 8:50am, End time was 3:28pm Thank you so much, Deb
Gregoryexcelsemipro.comApril 16, 2013 at 02:47 AM
Assume 8:50 AM is in cell A2 and 3:28 PM is in cell B2. If you put the calculation =B2-A2 into cell C2, the only thing left is to select cell C2 and bring up the Format Cells dialog box (keyboard shortcut CTRL+1 on a PC and CMD+1 on a Mac) then click the Number tab, and in the Category box select Time, and finally choose a format like 13:30 which has no AM or PM associated with it. The result will be 6:38 and is the result you are looking for.
Borune RoyChoudhuryApril 27, 2013 at 07:23 PM
Hi Gregory, Unfortunetly when working on Excel I put time using decimals. Eg. 17.25 was actually meant to be 17 hours and 25 minutes. Now when I try to convert that into the hh:mm:ss format in excel I'm getting 17:15:00 instead of 17:25:00. Is there a way to read the decimal in excel as the minute value only? Thanks.
Borune RoyChoudhuryApril 27, 2013 at 08:13 PM
Hi Gregory, I kept looking for the answer and I Got It... it is =DOLLARDE(A1,60)/24 for the value in decimal in A1 using the cell format [h]:mm:ss. Thanks anyway :)
Gregoryexcelsemipro.comApril 27, 2013 at 10:17 PM
Don't know about the formula you found, but his will work as well. =TIME(INT(A1),MOD(A1,1)*60,0) Cheers.
Balyahoo.comMay 3, 2013 at 05:28 PM
I've read everything here and can't find an answer for my problem. I have created a format (00\:00) to enter my time in a cell. This allows me to simply enter a number without having to enter the colon. My problem is I can't figure how to calculate this as time. Example: 0945-1800=8:15 but it calculates out as 8:55 because it is simply subtracting. Can you tell me, how I can make it calculate as hours.
Gregoryexcelsemipro.comMay 15, 2013 at 02:52 AM
Assume 0945 is in cell A1 and 1800 is in cell B1. You have to divide by 100 and then get the integer and fractional part. In cell A2 enter the formula: =INT(A1/100)+MOD(A1/100,1)*100/60 which will return 9.75 In cell B2 enter the formula =INT(B1/100)+MOD(B1/100,1)*100/60 which will give you 18. And finally in cell C2 enter the formula: =(INT(B2-A2)+(MOD(B2-A2,1)*60)/100)*100 to convert back to your original format, which returns 815 as the answer.
GemJune 26, 2013 at 03:17 AM
Hi! I need help badly. How can I have 13:15 PM in excel?It doesn't have a PM on it.. Just 13:15
Gregoryexcelsemipro.comJune 27, 2013 at 03:46 AM
You either get 13:15 which is military time and doesn't have PM or you have 1:15 PM. Both formats are controlled in the Format Cells dialog box. Use the keyboard shortcut Control+1 on a PC or Command+1 on a Mac to bring up the dialog box. Then select the Number tab, and in the Category box select Time. Then in the Type box pick the format that best suits your needs and click OK.