Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Converting Time Notation to Decimal Notation.
Written by Allen Wyatt (last updated February 20, 2026)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
Excel internally stores date and time values as floating-point numbers. The portion of the number to the left of the decimal point represents days elapsed since either January 1, 1900 or 1904 (depending on how your copy of Excel is configured). The portion of the number to the right of the decimal point represents the portion of a full day represented by the date and time.
Knowing this, you can easily convert a number from its time notation to its decimal equivalent. For instance, if you have an elapsed time value that represents 8:30, you can easily convert it to 8.5 (eight and a half hours) by multiplying the time value by 24.
To give another example, let's say that you have a beginning time in cell A3 and an ending time in cell B3. In cell C3 you place the following formula:
=B3 - A3
The result in cell C3 is the elapsed time, which is the difference between the beginning and ending times. This approach only works if the beginning time (A3) is less than the ending time (B3). This won't always be the case, particularly if the starting time is late one one day and the ending time is early on a later day. If you think you might have start and end times that occur on two days, then it is best to use a formula such as this:
=MOD(B3-A3,1)
Once you have the elapsed time, then in cell D3 you could then place the following formula:
= C3 * 24
The result in D3 is a decimal representation of the number of hours in cell C3. You can format the cell as you would any other number value so that it displays the number of decimal places desired. If you prefer to limit the number of decimal places in the result, right off the bat, you could instead use the following formula in cell D3:
=ROUNDUP(C3 * 24, 1)
This formula multiples C3 by 24 to convert to a decimal value, but then rounds the result to a single decimal place.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10700) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Converting Time Notation to Decimal Notation.
Program Successfully in Excel! This guide will provide you with all the information you need to automate any task in Excel and save time and effort. Learn how to extend Excel's functionality with VBA to create solutions not possible with the standard features. Includes latest information for Excel 2024 and Microsoft 365. Check out Mastering Excel VBA Programming today!
The NETWORKDAYS worksheet function can be used to easily determine the number of work days (Monday through Friday) within ...
Discover MoreNeed to figure out if a given year is a leap year? It's not as easy as you think! This tip provides a plethora of ways ...
Discover MoreEnter information into a worksheet, and you come to anticipate (and count on) how Excel will interpret that information ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2026-02-21 06:15:45
Mike J
@Donald Small
You're right of course - I had assumed that since multiple days might be involved, that A3 and B3 must therefore include dates and that the negative situation would only occur if the times were entered in the wrong columns.
2026-02-20 13:15:30
Donald Small
Note that if the DATE portion (left of decimal, non-zero) is included in each cell, MOD will not be needed (assuming B3 is a later DATETIME). This will always provide a positive number result and not create an error. Also note that the MOD example above only works if the elapsed time spans two consecutive days. If the span is greater than this, the MOD formula will need an edit to take this difference into account. You can avoid this by always including Date in the cell.
@Mike J -
MOD is used to convert a negative decimal into a positive number. The divisor "1" minus the negative number results in the positive value. Multiply by 24 to see the actual elapsed time in decimal.
For example, start time is 11pm (2300) yesterday and end time is 7am (0700) today. 0700 - 2300 = -0.5833 (negative). MOD using the "1" divisor results as positive 0.4167. Multiply * 24 = 8.00. Note this value format must be in decimal. If formatted as time, it will show some form of midnight, or in full date format as 1/8/1900 12:00 AM (exactly 8 days after 1/1/1900 00:00).
2026-02-20 07:01:51
jamies
there is the [hh] notation also [mm] and [ss] as well as using the custom formats
[hh]:mm:ss.000
[mm]:ss.000
[ss].000
[ss]
But do remember that only some Apps and utilities on some environments hold milliseconds !
And deal with DST -
even more "fun" when clocks go back - so if not GMT, which 01:20 and 01:05 are being used ?
and Excel's belief in the existence of 29/Feb/1900
And - that the value being held as floating point may be slightly different to the
and 3600000*hours+60000*minutes+1000*seconds
or 1000(seconds+60*(minutes+60*(hours)))
And if the value was a timestamp, with days - then that will mean that the accuracy at 16 sig digits will not be to 16 decimal places !
Indeed the 2 calculations above may generate different floating point values !
2026-02-20 04:34:15
Mike J
Should the second formula be =ABS(B3-A3)? Mod does not seem to work.
2021-02-06 15:14:58
Mike D'Onofrio
Just what I've been looking for. Thank you.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2026 Sharon Parq Associates, Inc.
Comments