CalcScope
Not a pretty-printer — a formula-analysis engine. CalcScope builds a live evaluation graph of one formula, explains in plain English why the result came out the way it did (locally, with no AI and no network), lets you drag what-if sliders that change nothing in the workbook, docks as a review cockpit, and gives you an auditable way to edit the formula in place.
What CalcScope is
When you open CalcScope on a formula cell, it parses the formula and builds an evaluation graph: every function, operator, argument, and reference becomes a node with a computed value and status. Conditional functions (IF/IFS/CHOOSE/ SWITCH/IFERROR) are evaluated lazily — only the branch that actually fired is computed; the others are marked skipped. From that one computed graph CalcScope drives four things: the breakdown tree, the Step Evaluator (the calculation in execution order), the Verified Calculation Explanation (a plain-English account of why), and the what-if sandbox. The same graph backs Dock CalcScope, a follow-the-selection review cockpit.
The breakdown: a live evaluation tree
The window shows a syntax-highlighted formula bar (references teal, constants ochre, strings plum, operators/parens flat gray — deliberately no rainbow), then a tree with letter badges on operators/functions and Element / Value / Info columns. Reference and named-range rows are navigable (hand cursor, go-to glyph): click one to select it in Excel and paint it green (a blue band for whole-row/column references), with the window smart-docking beside it. The source cell is tinted blue while open. A Find bar (Ctrl+F) searches the visible rows; a Copy menu exports the breakdown as Text, Markdown, RTF, or PNG.
What CalcScope understands
The Verified Calculation Explanation bar (Explain, Alt+A) is produced by a deterministic, pure-local builder that reads only values the graph already computed and function metadata — every explanation carries the line “Deterministic — recomputed locally. No AI, no network.” It states the result and, crucially, the reason, with sentence shapes for the patterns real models use:
- IF / IFS — the deciding test against real operand values, e.g. “AND is false because J$4 (01-Oct-2015) ≥ $D8 (01-Apr-2017) is false.”
- AND / OR — the decisive operand, or the collective truth (“all 2 conditions are true”).
- MAX / MIN — which argument won (from the winning-argument projection), including ties.
- CHOOSE / SWITCH — the selected branch/case and why, e.g. “CHOOSE took branch 2 of 4 because scenario (2.00) is 2”, “SWITCH used the default because no case matched Scenario (5.00).”
- IFERROR — whether the primary succeeded or the fallback was used, e.g. “The primary errored (#DIV/0!), so the fallback 0 was used.”
- Flags & masks — a 1/0 cell reads as an on/off flag (“On/off flag → 0 (off): …”), a TRUE/FALSE cell as a mask (“Mask → TRUE: …”), and a window-mask product (
value × (date ≥ start) × (date ≤ end)) is voiced once at its outermost multiply — naming the first false factor, or stating the pass-through when every condition holds. - Operand-level flag provenance — a referenced cell can be proven flag/mask-shaped from its own formula (the add-in builds that cell’s graph and checks it), e.g. “On/off flag → 1 (on): IF($G161=0,1,AD160) passed through AD160 (on)…” A value that merely happens to be 1 is never called a flag without that proof.
- Row-label citations — business row labels are woven in: the headline can read “Revenue — Result: 30” and an operand can be cited as “J8 (1,250) [Revenue]”.
- Linked-source relay — a formula that is just a reference to another sheet/cell is recognized as relaying that source, not as an independent calculation.
Everything here is value-faithful and suppression-first: if the builder can’t prove a shape (an unresolved name, an array-valued comparison, a degraded operand), it says nothing rather than guess.
Step Evaluator: the calculation, in execution order
Eval (Alt+E) opens the Step Evaluator — the graph projected into a post-order sequence (children before parents), i.e. the order an auditor reads a calculation, from leaf value sources up to the root result. This is fundamentally different from static formula indentation: indentation shows syntax; the Step Evaluator shows the actual execution against the live values.
- Each step shows the sub-expression, its computed value, and a green check for an evaluated result (a gray dash for a branch that wasn’t taken).
- Only the active branch of an IF/IFS/CHOOSE/SWITCH is evaluated; a genuine not-taken value slot is shown as one skipped-branch step, so you can see what the formula didn’t do without it cluttering the math it did.
- Click a step to select it; the host scrolls the matching row in the breakdown tree into view, so the execution list and the structure stay in sync.
What-if sliders: a no-write sandbox
Slider (Alt+W) turns the breakdown into a what-if sandbox. Drag a slider on an eligible numeric leaf and watch the result and explanation update — all in memory.
- Eligible inputs are numeric leaves: cell/named-range references and numeric constants. Identity is hybrid — a reference is keyed by its leaf identity, so overriding it moves every use of that cell together; a constant is keyed by its node, so each literal occurrence is its own slider.
- It writes nothing to the workbook. The override store is a pure in-memory overlay (there is no write path in it); the only Excel access is reading values. Excel’s undo stack is untouched.
- Each drag recomputes only the dirty cone — the nodes that read the changed leaf, every volatile node, and their ancestors — reusing every other cached value instead of re-evaluating the whole formula. If a change flips an IF/IFERROR branch (or a lookup’s matched cell), CalcScope does a structural rebuild so the now-active path is shown, not a stale one.
- Changed rows are tinted; the rows you dragged are additionally marked as direct overrides. The header subtitle shows the live what-if result, and a banner shows the override count with Reset (restores the baseline and returns the sliders).
- If the workbook session goes stale (the workbook is closed, a COM failure), what-if pauses safely with a warning rather than acting on a dead reference.
Dock CalcScope: a review cockpit
Dock CalcScope docks the breakdown as a task pane that follows your selection — a read-only cockpit for working through a model. The header carries Follow / Pause, Open-as-Window, and Pin left / right; a trace breadcrumb appears when you trace through cells; and a five-tab strip organizes the analysis:
- Explain — the same breakdown tree (or, for a hardcoded input, a value card with a “See what depends on this →” link).
- Inputs — the precedent cells, each with Preview (peek without moving the selection), Inspect (re-home the cockpit onto it), Go To (move Excel’s selection), and Expand (trace one level into that input’s own precedents).
- Impact — the cells that depend on the current cell, with Trace deeper to walk downstream (it extends the breadcrumb). Computed lazily on first open.
- Scope — an honest per-sheet summary: formula counts, constant counts, and distinct formulas. Computed lazily per sheet.
- Hidden — dependents that live on hidden sheets, with Reveal to temporarily un-hide a sheet (its exact prior visibility is restored when the cockpit closes).
Follow / Pause controls whether the cockpit tracks your selection; Inspect and Trace-deeper auto-pause so you don’t lose the cell you’re studying. The Impact, Hidden, and Scope scans are lazy — they run on first activation (or when the dependency index is invalidated), so opening the cockpit stays fast. There is no what-if or inline editor in the cockpit; use Open-as-Window for those.
Formula editing and audit behavior
In the floating window, Edit (F2) replaces the tree with an editor seeded from the live formula (the prior formula stays visible, read-only, above it).
Apply commits through the audit ledger — and the two steps aren't atomic
Apply commits the new formula through the shared formula-editor service: it writes the formula to the cell and appends an audit record to the causality ledger. The cell write clears Excel’s native undo stack — Ctrl+Z cannot revert it (the prior formula in the read-only bar is your manual reference).
If the cell write succeeds but the audit append fails, CalcScope does not pretend success: it keeps the editor open, shows a warning that the change wasn’t recorded in the audit trail, and lets you retry — the cell already holds the new formula. On a clean success it re-reads the live committed formula and rebuilds the graph so the tree, step evaluator, and explanation reflect exactly what is now in the cell. A rejected edit (cell unchanged) shows an inline error and stays open.
Classic Pretty Print
A fast, offline rendering of the formula as an indented, syntax-colored document with clickable references — no evaluation, no steps, no explanation. Ctrl+Shift+Y always opens this view (never CalcScope). It uses a distinct palette (functions blue, references green, numbers red, strings dark red, operators gray, rainbow parentheses by nesting depth) with a metadata panel (result if resolvable, function count, a volatile-function warning). Hovering a reference shows a hand cursor; clicking navigates Excel and green-highlights the cell. The source cell is tinted blue while open; Copy copies the raw formula text. Reach for it when you just need to read a long, nested formula — not analyze it.
A worked example
Open CalcScope on a project-finance output cell. Toggle the Step Evaluator to see the active IF path — which branch actually fired and the leaf values that drove it. Open Explain and read why: maybe a date mask is off because a period start is after the model date. Switch on the sliders and drag a start-date or volume input — the dirty cone recomputes in place and the result and explanation update, with nothing written to the workbook; Reset to return to baseline. Now open Dock CalcScope: inspect the Inputs, trace down through Impact to see what this output feeds, and Reveal a hidden-sheet dependent if needed. Only when you understand the formula and want to change it do you use Edit → Apply — which writes through the audit trail.
Safety summary
What-if sliders write nothing to the workbook (a pure in-memory overlay). The temporary highlights (source blue, navigation green/blue) are real cell fills, recorded and restored best-effort on close — they bypass undo, and an abnormal Excel exit may leave them in place. The cockpit’s Reveal restores a sheet’s visibility on close. Only Edit → Apply changes a formula, and that clears Excel’s native undo. CalcScope is single-source-workbook: cross-sheet references in the same workbook are navigated; cross-workbook references are out of scope.
Related
- TrustLens — adds proof/trust and references views, plus the same auditable editor, around a navigable diagram.
- Tracing & Flow Diagram — follow precedents/dependents across the sheet, or view structure as a graph.
- Sensitivity — rank which inputs move an output most.
- Proof & Trust — where an Edit → Apply audit record lands.