Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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.

Converting Time Notation to Decimal Notation

by Allen Wyatt
(last updated June 27, 2015)

3

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 you are 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, and 2013. You can find a version of this tip for the older menu interface of Excel here: Converting Time Notation to Decimal Notation.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Sorting or Filtering by Conditional Format Results

Conditional formatting is a great feature in Excel. Unfortunately, you can't sort or filter by the results of that ...

Discover More

Preserving Style Formatting when Combining Documents

Insert one document into another and you may not get the results you expect. Here's why, along with what you can do about it.

Discover More

Retrieving Web Query Data without Interruption

If you use Excel's Web Query tools to grab data from a website, you may run into some problems if the site isn't ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Converting an Unsupported Date Format

Excel makes it easy to import information created in other programs. Converting the imported data into something you can ...

Discover More

Calculating Weekend Dates

Do you look forward to the weekend? Well, you can use Excel to let you know when the next weekend begins. Here's how you ...

Discover More

Calculating an Age On a Given Date

Start putting dates in a worksheet (especially birthdates), and sooner or later you will need to calculate an age based ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 5?

2015-06-28 08:20:23

Michael

As noted in the Tip, Excel date functions accept a limited range of dates (days elapsed since either January 1, 1900 or 1904). Working with dates prior to that range is extremely complicated, for a variety of reasons. If you search for "using dates prior to 1900 in excel", you'll find many treatises on the subject, and macros available to support dates prior to 1900.


2015-06-27 12:55:39

pcn1112

HOW TO CALCULATE THE DIFFERENT BETWEEN
02nd Oct 1869 - to - 27th June 2015
-------------------------------------

how many years there. . . .???

how many months there . .? ?
how many Days there . . . .? ???

pls tell the formula sir.

thank you


2015-06-27 11:08:31

Jerry

Another clever way to handle the "over midnight" scenario is this formula:
=B3-A3+(B3<A3)
This takes advantage of the fact that the time value "1" represents 24 hours. So if the time in B3 is less than the time in A3, the result of the subtraction is a negative value. But the conditional statement, B3<A3, is TRUE, which Excel treats as a value of 1, thus adding 24 hours. (If the condition is false, the value is 0, and the subtracted value is the correct elapsed time.) However, it's important to remember to enclose the condition in parentheses, because comparison operators have a lower calculation precedence than addition and subtraction.


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.