This article contains information about two of the calculation settingsfor Microsoft Excel: iteration and maximum change. This article alsoincludes information about how the settings effect calculations when youuse circular references in formulas.
Iteration is the process of repeatedly calculating values in a worksheetuntil a specific numeric condition is met. In Excel, the condition is thelimit you set in the Maximum Iterations box on the Calculation tab in theOptions dialog box (click Options on the Tools menu).
To specify the maximum amount of change you will accept betweencalculation results, type the amount in the Maximum Change box. The smallerthe number, the more accurate the result and the more time Microsoft Excelrequires to calculate a worksheet.
Maximum change is the maximum amount of change you will accept betweencalculation results. To set this change value, type the number in theMaximum Change box on the Calculation tab of the Options dialog box.
The two calculation settings, Maximum Iterations and Maximum Change, are only enabled for that session of Excel. When you quit and restart Excel, the options return to their default settings. However, you can save a workbook that has custom calculation settings, so that when you open that workbook, the settings exist for the entire session, even if you close that workbook.
When Microsoft Excel calculates values in the worksheet, it repeatscalculations until it reaches the number of iterations you set in theMaximum Iterations box or until it changes all cells by less than theamount you set in the Maximum Change box, whichever is reached first.Unless you change the default iteration settings, Excel stops calculatingafter 100 iterations or when all calculated values change by less than0.001 (the default maximum change value) between iterations. Duringiteration, values move closer to the correct solution with each iteration.This is called "convergence."
If the change in the result, or the delta, is greater than or equal to thevalue in the Maximum Change box, Excel continues to calculate as long asthe limit in the Maximum Iterations box has not been reached. If thechange in result is less than the maximum change value, Excel stopscalculating.
Example 1: Large Iterations Value
To see an example of this calculation methodology, follow these steps:
- In a new workbook, click Options on the Tools menu. Click the Calculation tab and click Manual. Click Iteration. In the Maximum Iterations box, type 100. In the Maximum Change box, type 1. Click OK.
- Click cell A1 and type the following circular formula:
- The value 1 is returned in cell A1. Press the F9 key to recalculate the workbook.
Note that the value in cell A1 is 101. Each successive calculation increments the result by 100.
This is because each incremental change is never less than the maximum change value of 1. The circular formula adds 1 to the result. Because the maximum iteration value is 100, each iteration adds 1 to the value, which results in 1*100.
- Change the value in the Maximum Change box from 1 to 1.0001 and press F9 to recalculate the workbook. The result is incremented by 1 instead of by 100.
This behavior occurs because the value returned by the first calculation reaches the maximum change limit you set (that is, the change in result is less than the value you specified in the Maximum Change box).
Example 2a: Small Iterations Value
To see this example, follow these steps:
- Create a new workbook. On the Tools menu, click Options. Click the Calculation tab and click Manual. Click Iteration. In the Maximum Iterations box, type 1. In the Maximum Change box, type 0.001. Click OK.
- Enter the following in Sheet1:
A1: 1000 The initial result of the formula in cell A2 when you press ENTER is 100, or (1000+0)/10=100.
Press F9. The resulting value is 110, or (1000+100)/10=110. The change in result is 10.
Press F9 again, the resulting value is 111, or (1000+110)/10=111. The change in result is 1.
Press F9 again, the resulting value is 111.1, or (1000+111)/10=111.1. The change in result is 0.1.
Press F9, the resulting value is 111.11, or (1000+111.1)/10=111.11. The change in result is 0.01.
Press F9, the resulting value is 111.111, or (1000+111.11)/10=111.111 The change in result is 0.001, which is equal to but not less than the value you specified in the Maximum Change box (0.001).
Press F9, the resulting value is 111.1111, or (1000+111.111)/10=111.1111 In this case the change in result is 0.0001, which is less than the value you specified in the Maximum Change box. We would expect Excel to stop calculating if you set maximum iterations above 6.
If you set maximum iterations to 100, and you reenter the formula in cellA2, the initial resulting value in A2 is 100. When you press F9, theresulting value is 111.1111 (as expected). When the workbook isrecalculated again, Excel calculates once, and then halts because thechange in result after first calculation is less than the maximum changevalue (The limit of 15 significant digits in Excel applies).
NOTE: This example is a continuation of Example 2a; you must follow thesteps for Example 2a before you follow the steps for the followingexample.
To see this example, follow these steps:
- On the Tools menu, click Options. Click the Calculation tab and click Manual. Click Iteration. In the Maximum Iterations box, type 1. In the Maximum Change box, type 0.001. Click OK.
- Type the following in cell D1:
- Retype the formula in cell A2 as follows:
- Press F9 to recalculate the formulas in the workbook. Excel repeats the calculation 100 times.
This behavior occurs because the amount by which the value in cell D1 changes never exceeds the limit you set in the Maximum Change box (the change in the result remains below 0.001).
In this case, Excel recognizes at least one formula in which the limitsfor halting calculation are not met and Excel continues to calculate theformula. Since, by definition, a circular reference is never completed,Excel calculates all circular reference formulas until they meet eitherthe maximum iteration or the maximum change limits.