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.
by Allen Wyatt
(last updated September 19, 2015)
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.
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!
Excel allows you to display the results of several common worksheet functions on the status bar. The available functions ...Discover More
What is Office 365 and how does it relate to the version of Excel you have? This tip provides what you need to understand ...Discover More
One of the settings you can make in Excel is to specify a user's name. This name is accessible through macros, and can ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.