Excel Formula Dependency Map
Operator: Abdulla Al Fahad. How tools are built and checked
A workbook with 3,000 formulas hides a question that matters before anyone edits it: if this input changes, what moves? Excel draws trace-precedents arrows one cell at a time and shows a circular reference one cell at a time, but neither lists every link in the file or says which typed numbers nothing reads.
This tool parses every formula, turns each reference into an area on a sheet, and builds the whole graph at once. You can trace any cell up or down several levels, see the loops, list the numbers that no formula covers, and look at how the sheets depend on each other in a diagram.
Everything is read from the workbook as saved: the file is never changed, and the page works from the results Excel stored.
Key features
- Trace what a cell reads, down to eight levels, with ranges expanded to the formulas inside them
- Trace what depends on a cell, with the formulas that read it and the formulas that read those
- Circular references found by strongly connected groups, including a formula that reads its own cell
- Typed numbers that no formula, name or table reference covers
- A sheet-level diagram with the number of formulas on each link, loops in red, saved as SVG
- Defined names and table columns followed to their cells
- Dependencies as CSV, or the whole map as an Excel file with five sheets
How references become a dependency graph
Each formula is split into tokens by the lexer the formula audit uses. References with a sheet prefix (Data!B2, 'Summary Sheet'!B2:C9) and 3-D prefixes (Sheet1:Sheet3!A1, expanded to every sheet between) become areas, as do whole-column and whole-row references: A:A is 1,048,576 cells. Dollar signs make no difference. References into another workbook are counted but not followed, and a reference to a deleted sheet or a #REF! is counted as untraceable.
A defined name used in a formula is followed to the range it holds, and the reference is marked as reached through that name; names that hold a formula or a constant rather than a range are not followed. Table references are resolved when they have the forms Table[Column], column spans such as Table[[Qty]:[Total]], [@Column] inside the table, [[#This Row],[Column]], and the #All, #Headers, #Totals and #Data items.
Results shown are the values Excel saved in the file; formulas are not evaluated again. A formula cell is any cell that stores a formula, each cell of a shared formula included. Typed numbers are numeric cells with no formula; text, dates and true or false values are not counted as numbers.
Limits: .xlsx and .xlsm up to 25 MB and 400 MB unpacked, 200,000 formulas and 2,000,000 filled cells. Legacy .xls and workbooks protected with a password to open are refused with an explanation.
How it works
The workbook is read with exceljs, hidden sheets included, and shared formulas are expanded to one formula per cell. Each formula's references become areas, and areas that cover single cells go into an index by cell so "what reads this cell" is a lookup.
To find which formulas sit inside a range, the tool walks whichever is smaller: the cells of the range or the formulas on that sheet. Work is capped at 60 million steps, and if a workbook exceeds it the page says that circular references through ranges were not fully checked.
Loops are found with Tarjan's algorithm over the formula-to-formula graph, written without recursion so a chain of 100,000 formulas cannot overflow the stack. A group of two or more formulas, or one formula that reads itself, is a loop.
Unused numbers are found by marking every cell covered by a reference of up to 2,000 cells and testing the remaining numbers against the larger areas one by one. The sheet diagram puts sheets that read nothing on the left and moves each sheet to the right of everything it reads, stopping after a pass limit when sheets read each other.
Common use cases
- Before changing a tax-rate cell on an Assumptions sheet in a 3,000-formula model, trace what depends on it to four levels to see every output that will move.
- A model that shows Excel's circular-reference warning on opening: the loop list names the cells, and the trace of any one of them shows the chain it sits in.
- An inherited budget workbook: the numbers-nothing-reads list turns up 40 typed values that no formula covers, candidates for leftovers from an earlier version.
- Before splitting a workbook into two files, check the sheet map: a sheet with no arrows in or out can be moved alone.
- Documenting a model for an auditor: the Dependencies sheet of the Excel export lists every reference with its formula, the area read and the cached result.
- Finding formulas that read a whole column such as A:A, which silently include every row added later: sort the CSV by Cells read and look for 1,048,576.
How to use this tool
- Drop the workbook and wait for the overview counts.
- Look at the sheet map and the loop list for anything unexpected.
- Choose a sheet and a cell, a number of levels, and whether to show what it reads or what depends on it, then press Trace.
- Read the numbers-nothing-reads list for stale inputs.
- Save the dependencies as CSV or the full map as Excel.
Example
A three-sheet workbook with 12 formulas
Data: B2:C5 hold Price and Qty, D2:D5 =B*C, D6 =SUM(D2:D5); H1 = 999 and H2 = 5 typed
Summary Sheet: B1 = 0.2 named TaxRate, B2 =Data!D6*(1+B1), B3 ='Summary Sheet'!B2+TaxRate+Data!A1, B4 =B5+1, B5 =B4*2, B6 =B6+1
Report: B1 ='Summary Sheet'!B2+Data!D6What the map reports
What 'Summary Sheet'!B2 reads, 3 levels: Data!D6 (=SUM(D2:D5)), which reads the range D2:D5 (4 cells) of the Total formulas, plus the input B1 = 0.2
What depends on Data!B3: Data!D3, then Data!D6, then 'Summary Sheet'!B2, then B3 and Report!B1
Circular references: 2, the pair 'Summary Sheet'!B4 and B5, and B6 on its own
Numbers nothing reads: Data!H1 (999) and H2 (5), and two numbers in an unused table column
Sheet links: Summary Sheet reads Data in 3 formulas, Report reads Summary Sheet in 1 and Data in 1Tips for best results
- Start with two levels. A deep trace of a busy model stops at 400 nodes and says so, and the first two levels usually answer the question.
- Trace what depends on an input cell and the tree ends at the outputs; trace what an output cell reads and it ends at the inputs.
- The Formula cells sheet of the Excel export counts, for each cell, how many formulas it reads and how many read it, so sorting by the second shows the hubs.
Common pitfalls
INDIRECT and OFFSET build their targets while calculating, so only the literal references inside them are read: in OFFSET(A1,2,0) the cell A1 is traced, not the cell two below it.
References from charts, pivot tables, data-validation lists, conditional formatting, macros and other workbooks are not traced, so a number used only there appears under unused numbers.
Results are the values saved with the file. A file written by a program that does not calculate may have empty results, which shows as blank values in the trace.
Dynamic array formulas are read at the cell that holds them. The cells they spill into are stored as plain values, so numeric spill results can appear in the unused list.
A loop is reported even when the workbook has iterative calculation switched on deliberately.
Common errors and how to fix them
- "This is an older .xls file, or a workbook protected with a password to open"
- Remove the password in Excel if there is one, then save a copy as .xlsx and choose that.
- "This workbook has more than 200,000 formulas"
- Split the model, or delete sheets that are only archives, and map the part you care about.
- "does not hold a formula, so it reads nothing"
- You asked what a typed value reads. Switch to What depends on it to see the formulas that use that cell.
Best practices
- Look at the loop list first. A circular reference makes every value in its chain suspect, so tracing anything inside one is less useful until it is understood.
Reading the sheet map
Each box is a sheet with its number of formulas and typed numbers, and a hidden sheet is greyed. An arrow runs from a sheet that is read to the sheet that reads it, labelled with how many formulas on the reading sheet use it. A model usually flows from left to right, with input sheets on the left and reports on the right. A red arrow is part of a loop between sheets, where two sheets read each other.
What counts as an unused number
A typed number is listed when no formula's references cover its cell, directly, through a defined name or through a table reference.
- Header years and row labels that are numbers are listed too, since nothing tells them apart from inputs.
- A number inside a range that a formula reads, such as the middle of A2:A100, counts as used.
- Dates and numbers stored as text are not numbers here and are never listed.
The exports
The CSV holds one row per reference. The Excel file adds four more sheets.
- Dependencies: formula cell, formula, the area it reads, cells read, kind, name or table it came through, and result.
- Formula cells: each formula with the formulas it reads, the formulas that read it, and whether it is in a loop.
- Circular references, Unused numbers and Sheet links: the loop list and the unused numbers as on the page, and the sheet links behind the diagram.
Frequently asked questions
How does this differ from Excel Formula and Error Audit?
That tool hunts for error values, hard-coded numbers inside formulas and formulas that break a pattern. This one is about structure, meaning what reads what, so it finds loops and unused inputs rather than mistakes inside single formulas.
Why does a number I know is used show as unused?
Something other than a formula's cell references reads it: a chart, a pivot table, a validation list, a macro, an INDIRECT call, or another workbook. Those readers are not traced, so treat the list as candidates to check rather than a delete list.