XL: YEARFRAC() Function Returns Incorrect Results

ID: Q90071


The information in this article applies to:


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.

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.


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


  3. Choose the OK button.



REFERENCES

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

Additional query words: 4.0 5.0 XL4 XL5


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: March 29, 1999