Microsoft KB Archive/90071

{|
 * width="100%"|

XL: YEARFRAC Function Returns Incorrect Results

 * }

-

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.

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.