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

Understanding Operators

At the heart of working with Excel is the process of creating formulas that calculate results based on information within a ...

Discover More

Opening Multiple Workbooks at Once

Need to open a bunch of workbooks from within Excel? It's easy to do when you construct a selection set in the Open dialog ...

Discover More

Printing Custom Properties

Do you use custom document properties? They can be very helpful, but sometimes hard to get at. This tip shows a way you can ...

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)

Fixing a Numeric Keypad Key

We all expect the keyboard keys to operate as normal, and when they don't, it can be bothersome. Geraldine had such a ...

Discover More

Excluding a Specific Add-In at Startup

Got an add-in that you don't want loaded each time that Excel starts up? Here are a few ways that you can exclude it.

Discover More

Controlling Automatic Backups

Excel can make backups whenever you save your workbook. If you want to turn the feature on or off, this tip explains how to ...

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 6 - 0?

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.