Partial Calculation
The calculation chain might be saved after initially entering the data and saving the workbook, as follows:
<calcChain xmlns="…"> <c r="D10" i="1"/> <c r="C10"/> <c r="A3"/> <c r="B3"/> <c r="A4"/> <c r="B4"/> <c r="A5"/> <c r="B5"/> <c r="A6"/> <c r="B6"/> <c r="A7"/> <c r="B7"/> <c r="A8"/> <c r="B8"/> <c r="A9"/> <c r="B9"/> <c r="A10"/> <c r="B10"/> <c r="B2"/> <c r="A2"/> </calcChain>
Every <c>
element represents a cell containing a formula. The first cell calculated appears first (top-to-bottom), and so on. The reference attribute @r
indicates the cell's address in the sheet. The index attribute @i
indicates the index of the sheet with which that cell is associated. The sub-chain attribute @s
(not present in this first example) indicates that this cell can be treated as a sub chain of the preceding cell. Sub-chains can be useful when calculation can be multi-threaded or calculated concurrently. Whenever a cell does not contain an @i
or @s
attribute, it is understood to inherit these values from the previous cell.
Because of the way in which the workbook was initially created and saved, cell D10
should be the first cell calculated. The reason for this, which cannot be determined from examining the XML, is that cell D10
is the only cell that needs calculating, due to the partial calculation optimization. Since the cells A2:B10
and C10
were previously calculated (as a result of entering formulas in those cells), when entering the formula in D10
, D10
is the only cell that needs to be calculated.
This calculation chain indicates that after D10
is calculated, C10
can be evaluated. In looking at the dependencies, it is understood that during a full calculation, C10
would be evaluated before D10
can be evaluated. However, because of the partial calculation optimization, at the time C10
was entered, it was placed first on the calculation chain to be evaluated. Subsequent to that, D10
was entered, and so C10
was moved to second position in the calculation chain, and that is why it is currently in the second place.
Moving through the rest of the cells with this same logic, just before C10
was entered, A3
, then B3
, then A4
, then B4
, and so on up to A10
and B10
were added and then evaluated as part of the fill-down operation.
Finally, cells A2
and B2
were the first formulas to be added and calculated. All formulas in the workbook were added after A2
and B2
were evaluated. Since A2
and B2
didn't need to be re-evaluated (due to the partial calculation optimization) after that, they eventually settled to the end of the calculation chain.