Written by Allen Wyatt (last updated February 6, 2021)
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.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
When working with dates in a worksheet, you may need to do some rather esoteric calculations on those dates. This tip ...
Discover MoreIf you store dates in your worksheets, you may want to update those dates at the end of the year. This tip explains ...
Discover MoreEver wonder how to calculate the date for Thanksgiving in the United States? In this tip you discover not only that, but ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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 © 2025 Sharon Parq Associates, Inc.
Comments