XL: DATE Function Behaves Differently in Microsoft Excel 97

Last reviewed: February 26, 1998
Article ID: Q180158
The information in this article applies to:
  • Microsoft Excel 97 for Windows
  • Microsoft Excel 98 Macintosh Edition

SYMPTOMS

In the versions of Microsoft Excel that are listed at the beginning of this article, when you enter a formula that uses the DATE function, the date returned by the function may be incorrect. For example, if you enter this formula

   =DATE(1899,1,2)

the formula returns 1/2/3799. The expected result is 1/2/1899.

CAUSE

The versions of Microsoft Excel listed at the beginning of this article handle the year argument of the DATE function differently than earlier versions of Microsoft Excel do. These differences are listed in the following table.

                                                   Earlier versions
   Year               Microsoft Excel 97           of Microsoft Excel
   -----------------------------------------------------------------------

   0 through 178      Adds 1900, producing dates   Adds 1900, producing
                      from 1900 through 2078       dates from 1900 through
                                                   2078

   179 through 1899   Adds 1900, producing dates   Not accepted; function
                      from 2079 through 3799       returns #NUM! error
                                                   value

   1900 through 2078  Not changed; dates are       Not changed; dates are
                      from 1900 through 2078       from 1900 through 2078

   2079 through 9999  Not changed; dates are       Not accepted; function
                      from 2079 through 9999       returns #NUM! error
                                                   value

   10,000 or later    Not accepted; function       Not accepted; function
                      returns #NUM! error value    returns #NUM! error
                                                   value

Note that if a workbook is using the 1904 date system and if the DATE function returns a date from 1900 through 1903, the function returns a #NUM! error value. For more information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q175753
   TITLE     : XL: DATE Function May Return #NUM! Error When Year Is 0-3

STATUS

This behavior is by design of the versions of Microsoft Excel that are listed at the beginning of this article.

MORE INFORMATION

Earlier versions of Microsoft Excel can handle only dates from 1/1/1900 through 12/31/2078; the versions of Microsoft Excel that are listed at the beginning of this article can handle dates from 1/1/1900 through 12/31/9999.

Because Microsoft Excel does not recognize dates before 1/1/1900, if you enter a formula in which the year argument of the DATE function is less than 1900, Microsoft Excel adds 1900 to the year argument, and then attempts to display the date. For example, consider the following formula:

   =DATE(98,7,5)

Because the year argument (98) is less than 1900, Microsoft Excel adds 1900 to the argument (1900 + 98 = 1998) and returns the following date:

   7/5/1998

Because earlier versions of Microsoft Excel cannot handle dates greater than 12/31/2078, if the value of the year argument becomes larger than 2078, the DATE function returns a #NUM! error value. This is normal behavior for earlier versions of Microsoft Excel.

However, because Microsoft Excel 97 can handle dates through the year 9999, you do not receive a #NUM! error value unless the value of the year argument is greater than 9999.


Additional query words: XL97 y2k year2000 1901 1902
Keywords : xlformula kbdta
Version : WINDOWS:97; MACINTOSH:98
Platform : MACINTOSH WINDOWS
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 26, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.