Microsoft KB Archive/221075

= XL97: Certain Functions Calculate Differently in Early Versions of Excel =

Article ID: 221075

Article Last Modified on 11/23/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition

-



This article was previously published under Q221075





SYMPTOMS
When you use certain functions, you may receive a different value depending on the version of Microsoft Excel you are using.



CAUSE
This behavior occurs when the following conditions are true:  You create a workbook in Microsoft Excel for Windows 95, version 7.0 or earlier.

-and-

  You use one of the following functions and set the basis parameter to 2:

YIELD ODDFYIELD ODDFPRICE

-and-

 You open the workbook in Microsoft Excel 97.

This behavior also occurs when you create a workbook in Microsoft Excel 97 and save it in the Microsoft Excel 95/5.0 format. When you open the workbook in Microsoft Excel 7.0 or earlier these functions return a different value.



MORE INFORMATION
The method that you use to calculate these functions when the basis parameter is set to 2 was changed after Microsoft Excel for Windows 95, version 7.0, to produce more accurate values than in earlier versions of Microsoft Excel. Basis is the type of day count basis used by the function and is defined in the following table:

Because these functions were improved, they return different values than in Microsoft Excel 7.0 and earlier. Additionaly, if a workbook that you create in Microsoft Excel 5.0 or 7.0 is opened in Microsoft Excel 97, the results from Microsoft Excel 5.0 or 7.0 may still be displayed. Even if you save the workbook in Microsoft Excel 97, close and then reopen it in Microsoft Excel 97, the original values may still be present.

If you recalculate the workbook by pressing F9, the issue may not be resolved. Microsoft Excel will not recalculate to show the correct value until either you edit the formula, change the source cells, or recalculate the entire workbook.

To fully recalculate all formulas, use one of the following methods:
 * Press CTRL+ALT+F9. When you use this key combination, Microsoft Excel completely recalculates all cells in all open workbooks.


 * Create and run a Microsoft Visual Basic for Application level Sub procedure to recalculate all cells in all open workbooks.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

The following sample procedure will recalculate all values in the Excel 97 workbook each time it is opened. Note that this procedure recalculates the workbook only once each time it is opened. Private Sub Workbook_Open Application.SendKeys "^%{F9}" End Sub NOTE: Do not attempt to use a Worksheet_Activate or a Worksheet_Calculate procedure to recalculate the values. If you do this, a recursive process begins, and Microsoft Excel performs very slowly. For example, do not use the following procedures: Private Sub Worksheet_Activate Application.SendKeys "^%{F9}" End Sub -or- Private Sub Worksheet_Calculate Application.SendKeys "^%{F9}" End Sub The following steps demonstrate the issue with the YIELD function.   Type the following data in a new workbook in Microsoft Excel for Windows 95, version 7.0 or earlier: <pre class="fixed_text">A1: 2/18/99 A2: 6/16/02 A3: .11875 A4: 71 A5: 100 A6: 1 A7: 2 A8: =YIELD(A1,A2,A3,A4,A5,A6,A7) The value in cell A8 is 0.257365886. </li> Save the workbook as Test.xls and close Microsoft Excel.</li> Start Microsoft Excel 97 and open the Test.xls workbook. Press CTRL+ALT+F9 to recalculate the workbook. The value in cell A8 is now 0.257726542.</li></ol>

<div class="references_section">