Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: How Excel Stores Dates and Times.

How Excel Stores Dates and Times

Written by Allen Wyatt (last updated January 25, 2022)
This tip applies to Excel 97, 2000, 2002, and 2003


2

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 since 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.

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 (2176) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) 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

Trimming Spaces from Strings

When processing text with a macro, you often need to remove extraneous spaces from the text. VBA provides three handy ...

Discover More

Hiding Spelling Errors

When you are typing in a document, Word normally checks your spelling in the background, marking possible spelling errors ...

Discover More

Printing Multiple Worksheets on a Single Page

Got a bunch of worksheets and you want to save paper by printing multiple worksheets on a single piece of paper? There ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (menu)

Finding the Previous Work Day

Excel has a number of functions that are available as an add-on in the Analysis ToolPak. One of these functions allows ...

Discover More

Setting a Default Date Format

Enter a date into a cell, and Excel allows you to format that date in a variety of ways. Don't see the date format you ...

Discover More

Adjusting Date Values by Keypress

Excel allows you to store dates in a cell. Wouldn't it be great if you could select a cell containing a date and then ...

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}] (all 7 characters, in the sequence shown) 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 7 - 7?

2022-03-29 22:35:01

Peter

Hi Tim
If you just want to deal with clock time in your example, you need to discard the integer number of days to the left of the decimal point. Otherwise you are dividing (1+0.77791203703704) by 3 and will get the expected answer 0.592637346 or 2:13:24 PM.

You can get the fractional part representing clock time by using one of the expressions MOD(A1,1) or A1-INT(A1)

You have also discovered that day 1 of the Excel calendar is 1/1/1900. Day 0 is 0/1/1900.
So the formula bar was correctly showing a date-time value of 1 day, 18h, 40min, 12 sec albeit as 1/01/1900 6:40:12 PM


2022-03-28 17:39:47

Tim

if this is all true, then explain why one cannot simply divide a time and get the correct results? for example, a time is stored in cell a1 with a value of 1.77791203703704. formatting that to hh:mm yields 18:40, with the formula field showing 1/1/1900 6:40:12 PM. Dividing the value by 6, i would expect to see 3:06, but instead i see 7:42.
I can get to the correct 3:06 by using the equation "=((hour(a1)*3600+minute(a1)*60+second(a1))/6)/86400", (convert time to number of seconds), divide by 6, then convert back to fraction of a day. but why can i not just divide the fraction of the day by 6 and get the same results? I know I'm missing something!


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon 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.