Excel: YEARFRAC() Function Returns Incorrect Results

Last reviewed: November 29, 1994
Article ID: Q90071
The information in this article applies to:
  • Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0

SYMPTOMS

In the versions of Microsoft Excel for Windows listed above, the YEARFRAC() function returns an incorrect result if the 1904 Date System option is selected.

MORE INFORMATION

YEARFRAC() returns the fraction of a year represented by the period from the start date to the end date. For example, given a start date of 1/1/92 and end date of 6/30/92, YEARFRAC() returns 0.5, that is, the fraction of the year represented by the dates from January 1 to June 30, is one-half.

The 1904 Date System alters the way Microsoft Excel calculates serial dates by changing year one from 1900 to 1904. The purpose of the 1904 Date System option is to allow compatibility between version 1.5 or earlier versions of Microsoft Excel for the Macintosh and Microsoft Excel for Windows.

To get correct results using YEARFRAC(), clear the 1904 Date System option.

To clear the 1904 Date System option:

Microsoft Excel 5.0

  1. From the Tools menu, choose Options.

  2. Select the Calculation tab, and clear the 1904 Date system option.

Microsoft Excel 4.0 and 4.0a

1. From the Options menu, choose Calculation.

  1. In the Calculation Options dialog box, clear the 1904 Date System option.

  2. Choose the OK button.

REFERENCES

"Microsoft Excel User's Guide 1," version 4.0, pages 172-173


KBCategory: kbusage
KBSubcategory:

Additional reference words: 4.0 4.00


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: November 29, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.