Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. 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 February 19, 2020)

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, 2013, 2016, 2019, and Excel in Office 365. 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 the Default Font

Don't like the font that Word uses for a default in your new documents? You can pick a different font, but the way you ...

Discover More

Getting the Expected Space Before a Heading

If your heading styles are designed to add extra space before the heading, you may be surprised when that extra space is ...

Discover More

Bypassing the Startup Macro

Word allows you to create a macro that is run automatically whenever the program is started. If you want to bypass the ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Displaying a Hidden First Column

Hiding columns is easy, even hiding column A. How, then, do you get that left-most column displayed again? Here are a few ...

Discover More

Selecting a Suggestion with the Keyboard

Excel tries to anticipate what you want to type into a cell, particularly when it comes to entering formulas. Here are ...

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
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 nine more than 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.