How the product handles dates:
Storage:
Microsoft Excel stores dates as numeric values, with day #1 being 01/01/1900. . Excel 5 recognizes 01-JAN-1900 through 31-DEC-2078 as valid dates. 01/01/2000 is stored as value 36526, since it is the 36526th day in the century.
Formatting:
When Microsoft Excel formats a date, it uses one of several default formats. The most common is the system short date. If the system short date is a YY format (2-digit year), then even when the user types a YYYY date (4-digit year), it will by default display in a YY format. The format can be changed. To avoid any ambiguity we recommend changing the system short date to a YYYY format.
Parsing on date entry:
If a user enters a date in a "M/d/yy" format, less than 20 is 20XX, and equal to or greater than 20 is 19XX. For example, Excel 5 will recognize, "01/01/15" as January 1, 2015, but will recognize "01/01/25" as January 1, 1925. To avoid any possible confusion, users can always display dates in a YYYY format so the century is clearly shown
Leap Year:
Microsoft Excel treats 1900 as a leap year for backward compatibility with other products such as Lotus 1-2-3. (See Knowledge Base article Q181370 for more information.)
Two-digit shortcut handling:
See discussion above. Conversion of 2-digit shortcut dates assumes a date window of 1920 through 2019.
(See Knowledge Base (KB) article Q164406 for more information.)
What are the acceptable deviations?
MS Query accepts two-digit year date formatting for your ODBC query, but will always assume a twentieth century date. To avoid this issue, you should always use four digit years for queries based upon date data.
Common date usage errors:
If a date is pasted from one application to another using only the last two digits of the year, Microsoft Excel might parse the date differently than the originating application calculated it. Example: In a non-Excel application, you have the date January 1, 1915. You copy the date, but your system settings are "M/d/yy", and all that is copied is the text "1/1/15". When you paste "1/1/15" into Microsoft Excel, it will parse the date to January 1, 2015. Such an error can also occur when one application is using a "M/d/yy" format while another application is using a "d/M/yy" format. This also applies to importing dates from text files. (See KB articles Q182766 for more information.)
The DATE() function is not designed to take 2-digit year shortcuts, since it receives numeric parameters. The DATE() function calculates a number less than 1900 as an offset from 1900. So, if you were to enter a formula such as =DATE(15,1,1), the resulting date would be January 1, 1915, not 2015.
Recording date entry in a macro only records the year according to the system short date format, which results in parsing a 2-digit year in playback. (See KB article Q182766 for more information.)
Using a format such as "Dec 98" will not function correctly at the year 2001. This is because 98 is too large to be the day of month, so Microsoft Excel assumes it is a year. However, Excel assumes "Dec 01" refers to December 1 of the current year. Since Microsoft Excel always stores the complete date, you can avoid ambiguity by entering a full date regardless of the display formatting. (See KB article Q180952 for more information.)
Microsoft Excel handles serial dates, the most common usage of dates, properly. Due to the ambiguous nature of text dates, there is always some potential for error. Use serial dates whenever possible and take great care when transferring text dates.
Change the default system short date format to include a 4-digit year. Get in the habit of using 4-digit year formats for dates in Excel. Such a practice will make the date visible if a user mistakenly enters a date in the wrong century. When dates must be transferred between applications, ideally they should be transferred as serial dates. They should never be transferred as an ambiguous text format that doesn't specify the century and causes confusion between month and day-of-month. For example, the text "2/1/25" could be interpreted as Feb. 1, 1925, Jan. 2, 1925, Feb. 1, 2025, or Jan. 2, 2025.
Defined names store references only as text strings. Since they do not store dates as serial values, they are vulnerable to century issues when a 2-digit year format is used. Using defined names in this way is also problematic because users who use a date format with an order other than M-d-y will experience miscalculations. Recommended usage is to define the name referring to a cell containing a serial date, which will avoid both of the above-mentioned potential problems.
Testing guidelines and recommendations:
In general, avoid testing in a production environment or with non-duplicated production files because we cannot predict side effects with other products. Interoperability testing with other Microsoft Office products can be conducted safely.
The following areas should be examined to verify whether dates are being properly used. The table below can be used to guide testing of Microsoft Excel within your organization.
Sub-system Component
File Various File Formats Avoid storing 2Y dates in text file formats such as TXT, DIF, CSV, PRN. The default column width with default fonts may truncate characters with date formats that have 8 digits and two separators. To correct, increase the column width, or change the font to a fixed-width typeface such as Courier New.
Data Import from: text, Databases, External data sources Sort Data imported from databases and other external sources is often imported as text. Importing 2-digit years will be parsed with the 2019/1920 cutoff. This is different from later versions of Excel, so use 4-digit years to prevent confusion.
Basic Use Functions Date Entry Natural Language Functions Functions referring to text dates will parse according to the 2019/1920 cutoff rule. Date entry will parse according to the 2019/1920 cutoff rule.
Visual Data Charts Since chart labels are normally used for display, and not for calculation, this shouldn't pose much of an issue.
VB/VBA Transfer between VB/VBA and cells Internally, VBA treats dates as serial values, exactly like Excel. However, since VBA uses the "M/d/yy" format, you should avoid transferring the date text through VBA, since it could parse to the wrong century. This will also help avoid issues with international users who have a system short date format with an order other than M-d-y.
Additional Testing Instructions:
Microsoft provides the tests below to aid customers in conducting their own year 2000 certification of Microsoft Excel.
Users who work with dates in Microsoft Excel will benefit from changing the system short date format to one that uses a 4-digit year, (i.e. "MM/dd/yyyy"). This change will allow the user to clearly see the century of a date. Conducting the below tests is only worthwhile if 4-digit years are used. If you decide not to set your system short date format to include a 4-digit year, you can format each cell individually by selecting Format/Cells/Number/Custom, and entering a 4-digit year format. To change the system short date format, press the Start button, then select Settings, Control Panel, Regional Settings, select the Date page, then change the Short Date Style to a format that includes a 4-digit year by replacing the "yy" portion with "yyyy".
Verify that Microsoft Excel transitions smoothly into the year 2000: Warning! Before conducting this test, make sure you do not have any software containing a license that expires by the year 2000. This is especially common with beta copies of software programs. If a program determines that its license has expired it is possible the program will no longer boot, even after resetting the system clock. Changing a system clock on a network can affect other computers connected to the network, so it is highly recommended that you isolate the computer from all other systems before changing the system clock to conduct the following test.
Set the system clock to 11:59 p.m. December 31, 1999. Start Excel. In cell A1 (cell R1C1 if in R1C1 mode), enter =NOW(). After one minute, press {F9} to recalculate the formula you entered in A1. Note that the time and date shown will be in the year 2000, and nothing unusual has happened to Excel. Remember to reset your system clock to the correct time and date after conducting this test.
Verify that Excel recognizes the year 2000 as a leap year: Start Excel. In cell A1 (cell R1C1 if in R1C1 mode), enter "=DATE(2000,2,28)+1". Note that the resulting date is February 29, indicating that Excel correctly recognizes that 2000 is a leap year.
Note: The year 1900 is not a leap year. However, in your testing you may notice Excel treats 1900 as a leap year. This algorithm was adopted to maintain compatibility with dates in Lotus 1-2-3, and is by design. The calculation for leap years used by the Gregorian calendar is as follows. If a year is evenly divisible by four, it is a leap year, unless the year is evenly divisible by 100. If a year is evenly divisible by 100, it is not a leap year, unless it is also evenly divisible by 400. (See KB article Q181370 for more information.)