Basic Examples (3)
Download an XLSX file:
Trace the dependencies of the cell D1:
Visualize it as an ExpressionTree:
Scope (4)
Trace a deeper spreadsheet dependency:
Trace formulas with absolute references:
Trace cross-sheet references:
Trace through a column range, expanding it across all rows:
Options (1)
TraceDuplicates (1)
Delete duplicate branches and show a more compact visualization:
Applications (3)
Find all the cells a formula depends on:
Measure the total dependency depth:
Visualize the full tree of dependencies:
Notice this ExpressionTree respects the ordering among dependencies, but their hierarchical structure is not captured perfectly. See proper Trace tree examples in Properties and Relations.
Properties and Relations (4)
The output of SpreadsheetTrace[file,cell] has the same form as the output of Trace, but truncated after the elementary leafs are reached.
To truncate Trace at the leafs use replacements rules like the this:
Find the full Trace of a double sum:
Its truncated version perfectly matches the output of SpreadsheetTrace[file,cell]:
Nevertheless, only the pure Wolfram Language Trace allows the drawing of a proper ExpressionTree, which respects all hierarchical relations:
See Possible Issues for other exceptions to the general analogy between SpreadsheetTrace[file,cell] and Trace.
Possible Issues (1)
In some examples, to achieve complete analogy with Excel formulas, Wolfram built-in functions like If need to be redefined so to be cleared of Attributes like HoldRest:
Still, in this case the analogy with Trace is not yet perfect because SpreadsheetTrace[file,cell] treats as Atom elements only spreadsheet formula cells and their values, ignoring numeric constants in relations such as C4>0 (0) and C1-C3 (-1).