Sub topic 7
Finding the Source of an Error with Trace Error
Assume you can write basic Excel formulas, use relative and absolute references, and understand the layout of a three-statement financial model. This chapter focuses on diagnosing an existing error, not on designing the model.
Why the visible error is often not the source
An error in an output cell may be the last link in a longer calculation chain. For example, an income statement margin may show #DIV/0! because revenue is zero. Revenue may be zero because a forecast input is missing. The output cell reports the failure, but the source is earlier in the chain.
Excel error values identify the type of failure:
| Error value | Typical cause | First check |
|---|---|---|
| `#REF!` | A referenced cell or range was deleted | Review the formula for broken references |
| `#DIV/0!` | A formula divides by zero or a blank denominator | Check the denominator |
| `#VALUE!` | An argument has the wrong data type | Check for text in a numeric calculation |
| `#N/A` | A lookup or deliberate diagnostic returned no result | Check lookup keys and source data |
| `#NAME?` | Excel cannot recognize a function or name | Check spelling and named ranges |
Do not replace an error with zero simply to make the model look complete. A visible error preserves the evidence needed to repair the calculation.
=IF(C12=0, NA(), D12/C12)This formula returns #N/A when the denominator is zero. It makes the missing or invalid condition visible instead of hiding it behind an arbitrary result.
Using Trace Error
When a cell displays an error, select that cell and use:
- Open the Formulas tab.
- Select Error Checking.
- Choose Trace Error.
Excel draws arrows from the selected error cell toward cells involved in the error. Follow the arrows backward. At each referenced cell, inspect the value and formula. Continue until you reach an invalid input, a broken reference, or an unexpected hardcoded value.
The arrows help you distinguish two cases:
- The selected cell directly contains the error.
- The selected cell receives an error from another formula or worksheet.
A dashed arrow can indicate a reference on another worksheet or workbook. Double-clicking the arrow may open a navigation list. Select the relevant reference to move to its source.
After investigating, use Remove Arrows on the Formulas tab. Leaving old arrows on the sheet can confuse a later reviewer.
A repeatable diagnostic sequence
Use this sequence rather than fixing the first cell that looks suspicious:
- Record the worksheet, cell address, error value, and displayed formula.
- Run Trace Error on the selected cell.
- Follow each arrow and record the referenced cell.
- Check whether the source is blank, text, zero, broken, or unexpectedly hardcoded.
- Correct the source only if the business logic supports the correction.
- Recalculate the model and confirm that the error disappears.
- Check nearby periods and dependent outputs for new or hidden errors.
- Remove the tracing arrows and record the finding.
If the error comes from a lookup, inspect both the lookup key and the lookup range. If it comes from a cross-sheet reference, verify that the referenced period and row are correct. If it comes from a named range, inspect the name definition rather than only the visible formula.
Recording the finding
A findings log makes the review reproducible. Record the cell, error, source, cause, action, and retest result.
| Cell | Error | Source | Cause | Retest |
|---|---|---|---|---|
| `Income_Stmt!H22` | `#DIV/0!` | `Income_Stmt!H18` | Revenue forecast was blank | Cleared after input review |
Exercise
A gross margin cell shows #DIV/0!, and Trace Error points to the revenue cell used as its denominator. What should you inspect before changing the margin formula?
Show answer
Inspect the revenue cell's source formula, forecast input, and period alignment. Confirm whether zero revenue is intended before changing the margin calculation.