Sub topic 9
Using Trace Precedents, Error Checking and Formula Views
This chapter assumes you can read the three statements, write basic Excel formulas, and have already built a balance check row (see "Building a balance check you can trust" and "Finding the first period that breaks"). Once you know which period first goes out of balance, Excel's auditing tools help you find the cell responsible.
Why use auditing tools
A balance check says that something is wrong. It does not say where. In a model with a few thousand formulas, scrolling and guessing wastes time. Excel includes three groups of tools that show how cells depend on each other:
- Trace Precedents and Trace Dependents draw arrows between cells.
- Error Checking flags cells that look suspicious by rule.
- Formula views show the formulas themselves instead of their results.
These tools do not fix anything. They narrow the search so that you inspect a handful of cells instead of the whole workbook.
Trace Precedents and Trace Dependents
A precedent is a cell that feeds a formula. A dependent is a cell that uses the result of another cell. If C30 contains =C10+C20, then C10 and C20 are precedents of C30, and C30 is a dependent of both.
You find these commands on the Formulas tab, in the Formula Auditing group. The keyboard shortcuts on Windows are:
| Action | Windows shortcut | What it does |
|---|---|---|
| Trace Precedents | Alt, M, P | Draws arrows from cells that feed the selected cell |
| Trace Dependents | Alt, M, D | Draws arrows to cells that use the selected cell |
| Remove Arrows | Alt, M, A, A | Clears all arrows |
| Select precedents (direct) | Ctrl+[ | Jumps to the cells that feed the formula |
| Select dependents (direct) | Ctrl+] | Jumps to the cells that use the formula |
| Show Formulas | Ctrl+` | Toggles formula view for the sheet |
Pressing the trace command once shows the direct precedents. Pressing it again shows the next level back. A dotted arrow with a small worksheet icon means the precedent is on another sheet. Double-clicking that arrow opens a list of the linked cells and lets you jump to one.
A worked trace
Suppose the first imbalanced period is 2026, and the balance check in E60 shows 10. Work backward from the failing total:
- Select the total assets cell for 2026 and trace precedents. Check that every asset line is included.
- Select the total liabilities and equity cell and trace precedents. A missing arrow to a line such as deferred revenue is a sign that the line is left out of the sum.
- Trace precedents on the cash line of the balance sheet. It should point to the ending cash on the cash flow statement, not to a typed number.
- Compare the arrows for 2026 with the arrows for 2025, which still balances. The structure should be the same. Any difference is a lead.
The comparison in step 4 is the most useful habit. Because the model is built so that formulas are consistent across a row, the correct structure for 2026 is already visible in 2025.
Trace dependents for hardcodes
Trace Dependents answers the opposite question. If you find a hardcoded number, such as a typed 42 in a row of formulas, trace its dependents to see what it contaminates. If the hardcode feeds the cash flow statement but not the balance sheet, that mismatch is the likely cause of the imbalance.
Error Checking
Excel can check formulas against a set of rules. Open it from Formulas, then Error Checking. Cells that break a rule get a small green triangle in the top-left corner. The rules live under File, Options, Formulas, "Error checking rules".
The rules most relevant to imbalances are:
| Rule | What it catches | Why it matters for balance |
|---|---|---|
| Inconsistent calculated column formula | A cell differs from its neighbors in a table | A one-off formula in a forecast row |
| Formulas inconsistent with adjacent formulas | A formula differs from the cells to its left and right | A single period using a different link |
| Formulas which omit cells in a region | A SUM that stops short of adjacent numbers | A new line item excluded from a total |
| Unlocked cells containing formulas | Formula cells that can be edited when protected | Accidental overwriting |
| Numbers formatted as text | A value stored as text | The cell is ignored in sums |
| Cells containing formulas that result in an error | #REF!, #DIV/0!, #N/A and similar | Broken links and bad references |
Two rules do most of the work in a balance investigation: "inconsistent with adjacent formulas" and "omit cells in a region". A SUM that omits a new row is one of the most common reasons a balance sheet stops balancing after you insert a line.
Limits of Error Checking
Error Checking judges a cell only by comparing it with its neighbors. This creates three blind spots:
- A whole row that is wrong. If every period uses the same bad formula, none of them is inconsistent, so nothing is flagged.
- A hardcode in a row of hardcodes. Historical columns often contain typed numbers on purpose, so a typed number in the forecast block may sit next to similar values and escape notice.
- Errors you have suppressed. Choosing "Ignore Error" removes the green triangle for that cell. Review ignored errors by using File, Options, Formulas, "Reset Ignored Errors" and then rechecking.
Treat a clean Error Checking result as weak evidence. Treat a flagged cell as a strong lead.
Formula views
Pressing Ctrl+` (the backtick key) switches the sheet to show formulas instead of values. With the formula view on, a row that should be consistent can be scanned by eye. Column widths grow, so you can read each formula.
Look for these patterns:
- A cell that shows a number instead of a formula in a forecast row. This is a hardcode.
- A formula that references a different row than its neighbors, such as
=D12in one cell and=E13in the next. - A formula with an added constant, such as
=D20+5. - A reference with a sheet name that differs from the rest of the row.
Select special: finding all constants
Formula view is slow on a large sheet. A faster way to find hardcodes is to let Excel select them for you:
- Select the forecast range on the sheet.
- Press F5, choose Special, then choose Constants. Leave only Numbers ticked.
- Excel selects every typed number in the range. Apply a fill color.
On a properly built forecast block, the only highlighted cells should be inputs on an assumptions area. Anything highlighted in a calculation row needs an explanation.
You can also choose "Row differences" in the same Special dialog. Select the row, then pick Row differences, and Excel selects the cells whose formula pattern differs from the active cell. This works well for finding the one period in a row that breaks the pattern.
Showing formulas as text
When you want a record of formulas next to the values, FORMULATEXT displays the formula of another cell:
=FORMULATEXT(E30)A helper row that shows the formula for each period lets you compare formulas side by side, and you can also compare them in code, as the next section shows.
Comparing formulas across a row with a script
Comparing formulas in R1C1 style makes a row of consistent formulas look identical. In A1 style, =D10+D11 and =E10+E11 look different even though they follow the same pattern. The following script reads formulas with the openpyxl library, converts column letters to relative offsets, and reports the periods whose pattern differs from the first forecast column. It assumes that formulas refer to cells in the same sheet by simple references.
import re
from openpyxl import Workbook
from openpyxl.utils import column_index_from_string, get_column_letter
def to_relative(formula, col_idx):
"""Replace each column letter with its offset from col_idx."""
def repl(match):
col = column_index_from_string(match.group(1))
return f"C[{col - col_idx}]R{match.group(2)}"
return re.sub(r"\b([A-Z]{1,3})(\d+)\b", repl, formula)
def inconsistent_cells(ws, row, first_col, last_col):
base = ws.cell(row=row, column=first_col).value
base_pattern = to_relative(str(base), first_col)
bad = []
for col in range(first_col + 1, last_col + 1):
value = ws.cell(row=row, column=col).value
pattern = to_relative(str(value), col)
if pattern != base_pattern:
bad.append(f"{get_column_letter(col)}{row}")
return bad
wb = Workbook()
ws = wb.active
ws["C20"] = "=C10+C11"
ws["D20"] = "=D10+D11"
ws["E20"] = "=E10+E11+5" # hardcoded adjustment
ws["F20"] = "=F10+F11"
print(inconsistent_cells(ws, row=20, first_col=3, last_col=6))
# ['E20']The script flags E20, where a constant was added. A typed number in place of a formula is also flagged, because its pattern is the number itself.
Error values and their meaning for imbalances
Formula errors usually stop a model from calculating, but a few cause quiet imbalances when wrapped in IFERROR. For example, =IFERROR(C10/C11,0) turns a division error into zero, so the balance sheet may balance in a broken state or lose a line without warning.
| Error | Typical cause in a three-statement model | Imbalance risk |
|---|---|---|
| #REF! | A row was deleted and a link pointed to it | The error spreads to totals, so the check shows an error rather than a number |
| #DIV/0! | A ratio uses an empty denominator, such as days of inventory | Often hidden by IFERROR, which converts it to 0 |
| #NAME? | A misspelled name or removed named range | Calculation stops |
| #VALUE! | Text in a numeric calculation | Spreads to totals |
Avoid blanket IFERROR wrappers in core statement formulas. They turn an obvious failure into a silent one. If a division can legitimately be zero, test for that case explicitly with IF.
Putting the tools in order
Use the tools in a fixed order so that you do not wander:
Re-run the check after each single fix. If you change several cells at once and the check turns zero, you cannot tell which change mattered, and a second error may have cancelled the first.
Common mistakes with auditing tools
- Tracing from the wrong cell. Start from the failing total, not from a line you suspect. Otherwise you confirm your own guess.
- Leaving arrows on the sheet. Arrows disappear on some edits and persist on others. Remove them before sharing the file.
- Trusting external links. Trace Precedents cannot show the contents of a closed workbook. Use Data, Edit Links to list external sources, and bring them into the model or remove them.
- Ignoring hidden rows and sheets. Formulas can sit in hidden rows. Unhide everything before you run Select Special.
- Reading only values. A value that looks right can come from a hardcode. Always confirm that a number is a formula.
Exercises
Exercise
The 2026 balance check shows 10, and 2025 balances. Trace Precedents on the 2026 total liabilities and equity shows arrows to every line except deferred revenue, which the 2025 total includes. What is the likely cause, and what is your next step?
Show answer
The 2026 SUM omits the deferred revenue row, probably because the formula range was not extended when the row was added or the cell was overwritten. Compare the 2026 formula with the 2025 formula in formula view (Ctrl+`), correct the 2026 range so it matches the pattern, and re-run the balance check.
Exercise
Error Checking shows no green triangles anywhere, yet a forecast row of interest expense uses =D5*0.05 in every period, with the rate typed into each formula. Why does Error Checking miss this, and which tool finds it?
Show answer
Error Checking compares each cell with its neighbors, and all cells share the same pattern, so none is inconsistent. A typed rate inside a formula is a hardcode that no rule detects. Formula view or Trace Precedents shows that the formula has no link to an assumptions cell, and the rate should be moved to a single input cell and referenced.
Exercise
Why is =IFERROR(C10/C11,0) risky in a core statement formula?
Show answer
If C11 is zero or empty, the error becomes 0 and the model keeps calculating. The wrong value flows into the statements and can create or hide an imbalance without any visible warning. A specific IF test for the zero case, or leaving the error visible, is safer.