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: How Excel Stores Dates and Times.

How Excel Stores Dates and Times

by Allen Wyatt
(last updated September 19, 2015)

5

Internally, Excel stores a date or time as a number. The whole part of the number (the part to the left of the decimal point) represents the number of days starting with an arbitrary starting point (typically January 1, 1900). The decimal portion (the part to the right of the decimal point) represents the time for that date. These internal representations of dates and times are often referred to as serial numbers.

To see how this works, enter the number 23 in a cell. If you have not previously formatted the cell, Excel uses the General format, displaying the number simply as 23. If you later format this cell using a date format—m/d/yy, for instance—Excel changes the display to 1/23/00, or January 23, 1900. (January 1, 1900, is 1; January 2 is 2; January 3 is 3; and so on.)

The portion to the right of the decimal point represents a fractional portion of a day. Thus, a single second would be equal to approximately 0.00001157407, since that is equal to 1 (a day) divided by 86,400 (the number of seconds in a day).

Since Excel stores dates and times as serial numbers, you can do math on them. For instance, if you wanted to determine the number of days between two dates, or the amount of time between two times, simply subtract them from each other. The result is the number of days and fractions of days between the two.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11337) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: How Excel Stores Dates and Times.

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

Changing Default Search Settings

Excel provides some great tools for finding information in a worksheet or a workbook. Changing the default settings used for ...

Discover More

Summing Absolute Values

You can easily sum a series of values in Excel, but it is not so easy to sum the absolute values of each value in a range. ...

Discover More

Inserting a Cross-Reference to the Last Style on a Page

It is often helpful to reference a specific heading in the header or footer of a page, and have that reference change on each ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Disabling a Function Key

Function keys are used to perform common tasks in Excel. If you want to disable one of the function keys, it's rather easy to ...

Discover More

Embedding Your Phone Number in a Workbook

Want to provide a bit of contact information in a workbook? A great place to do it (out of sight, but not inaccessible) is in ...

Discover More

Relative Worksheet References

Copy a formula from one place to another and Excel helpfully adjusts the cell references within the formula. That is, it ...

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 8Mpixels. 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 three more than 5?

2015-09-24 02:56:38

Peter Korva Hertz

A leap year can be divided by 4, but it is not a leap year if it can be divided by 100 - except if it can be divided by 400. So 1600 and 2000 should be leap year, and 1900 should not.

The error in 1900 date system can be avoided by using the 1904 date system.


2015-09-21 06:29:35

Willy Vanhaelen

@Tony and Chris

This is a known bug which Excel inherited from Lotus 1.2.3.


2015-09-21 04:14:32

Richard

When subtracting times to get an interval, I run into trouble when this results in a negative time interval which, I believe, Excel does not permit. To date (pardon the pun), I have used conditional formatting to colour such intervals red but ensure to calculate a positive result.


2015-09-21 03:58:39

Tony Nixon

Chris is absolutely right, I have just tried this on Excel 2010 and after Tuesday 28 Feb 1900 comes
Wednesday 29 Feb 1900. Only 00 years that are divisible by 400 (rather than 4) are leap years - or did this practice only start after 1900??

This prompts the question: 'At what point does Excel get the day and date back in sync' because it is OK today Monday 21st Sept 2015 - and has been correct for the 25 years I have been using Excel!


2015-09-19 06:42:22

Chris Finn

Interesting to note in passing that Excel thinks 1900 was a leap year -- which we all know it wasn't, in the Gregorian Calendar.
Enter a 1 in cell A1 and 2 in cell A2, then extend downwards about 70 cells.
Now turn these numbers into dates. Below Feb 28th, we should see Mar 1st, but Excel (at least, all versions I have used) inserts an unwanted Feb 29th...


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.