The calculation chain can change after each calculation because the calculation engine attempts to find the fastest way to calculate a workbook. The engine can calculate cells multiple times until it constructs the correct calculation sequence. The Spreadsheet saves this calculation sequence to the document and uses it in subsequent calculations.
When you change a cell value, the calculation chain determines cells that should be recalculated and marks them as needing calculation. It also recalculates cells that always need calculation.
When you edit data in a worksheet, all cells are marked for calculation. The Spreadsheet performs calculations on demand (for instance, to display a cell value).
The recursive engine does not need resources to store and maintain the dependency tree, so it is best suited for server-side components such as the Workbook. Server-based calculations are usually performed only once when a document is saved.
Cells That Always Need Calculation
Regardless of the calculation engine type you use, there are cells that always need recalculation (CalculateAlways cells). They include:
cells with references to other cells that always need recalculation
cells with circular references.
A circular reference occurs when a formula directly or indirectly refers to its own cell. Set the CalculationOptions.Iterative option to true to enable iterative calculations for formulas with circular references. If this option is false, the Spreadsheet does not recalculate such formulas.
Volatile functions (for example, RAND(), NOW(), TODAY(), and so on) can return a different result on each recalculation even if its arguments are the same. Whenever the Spreadsheet recalculates a workbook, it also updates volatile function values.
Recalculates all formulas each time a cell value, formula, or defined name changes. If the DocumentOptions.CalculationEngineType is ChainBased, the Spreadsheet recalculates only cells that are marked for calculation.
The Spreadsheet supports multi-threaded operations for the ChainBased calculation engine to increase formula calculation performance. Use the CalculationOptions.ThreadCount property to specify the number of calculation threads the Spreadsheet should use.