Sub topic 10
Diagnosing Circular References
This chapter assumes you can write formulas with relative and absolute references, you know the three-statement layout (income statement, balance sheet, cash flow), and you have used Trace Precedents and Trace Dependents. Here you learn what a circular reference is, how to find one, and how to decide whether to keep it or remove it.
What a circular reference is
A circular reference exists when a formula depends on its own result, directly or through a chain of other cells. Excel calculates cells in dependency order. It needs the precedents of a cell before it can compute that cell. If cell A needs B, B needs C, and C needs A, there is no valid starting point.
There are two forms:
- Direct: a cell refers to itself, such as
=B5+B6typed into B5. - Indirect: the loop passes through two or more cells, such as A1 to B1 to C1 and back to A1. Indirect loops are harder to spot because no single formula looks wrong.
By default, Excel does not calculate such a loop. It shows a warning and, in most cases, leaves the affected cells at 0 or at their last value. That is why a circular reference can quietly corrupt a model: the numbers look plausible but are not current.
Why circularity appears in financial models
Some loops are accidents. Others come from real financial logic. Knowing which kind you have is the main diagnostic decision.
| Cause | Example | Usually intended? |
|---|---|---|
| Range includes its own cell | `=SUM(C5:C20)` entered in C20 | No |
| Wrong row or column reference | A subtotal row pointing at a total that depends on it | No |
| Copy-and-paste misalignment | A formula pasted one row off so it references itself | No |
| Interest on average debt | Interest uses the average of opening and closing debt, and closing debt depends on cash flow after interest | Sometimes |
| Cash sweep | Debt repayment depends on cash flow, which depends on interest, which depends on debt | Sometimes |
| Interest income on average cash | Interest income depends on ending cash, which depends on net income | Sometimes |
The first three rows are errors. The last three are a modeling choice, often called a financing circularity, and they are legitimate only if the model is built to handle them.
Step 1: Detect the circular reference
When you open or edit a workbook and Excel finds a loop, it displays a warning that circular references may cause incorrect calculations. After you dismiss it, the status bar at the bottom left shows the text "Circular References" followed by a cell address, for example Circular References: F42.
Be careful with that address. It names one cell in the loop, not necessarily the cell that caused it. The status bar may also show nothing if the active sheet has no loop but another sheet does.
To list the loops:
- Go to Formulas, then Error Checking, then Circular References.
- Excel lists one cell address from the loop. Click it to jump there.
- Fix or inspect that loop, then reopen the menu. Excel lists the next loop if one remains.
If the menu item is greyed out, either no circular reference exists or iterative calculation is on (see below), which suppresses the warning.
Step 2: Trace the loop
Once you are on a cell in the loop, use the arrows you already know.
- Select the cell Excel named.
- Click Trace Precedents repeatedly. Each click adds the next layer of arrows.
- Follow the arrows until one points back to a cell you have already visited.
Excel draws arrows on a loop in a way that makes the return path visible. If your arrows double back on a cell, you have found the cycle.
You can also use Trace Dependents from the same cell and look for the arrow that returns to your starting point. The cells that appear in both the precedent chain and the dependent chain are exactly the cells in the loop.
For long loops, write the path down as you go:
Interest expense (IS!D18) -> Net income (IS!D30) -> CFO (CF!D8)
-> Net change in cash (CF!D25) -> Ending cash (BS!D5) -> Interest income (IS!D17)
-> Net income (IS!D30)Writing the path gives you a record for your findings log and lets you see which link can be broken.
Step 3: Decide whether the loop is intended
Ask these questions in order.
- Does the formula obviously include itself? Check ranges first, such as a total row summing a range that extends one row too far. This is the most common cause and the easiest fix.
- Does the loop go through interest, cash, or debt? If so, it may be a financing circularity.
- Does the model document it? An intended circularity normally has a labeled switch (see below), a note on the assumptions sheet, and iterative calculation enabled on purpose.
- Does it need to exist? Many financing circularities can be removed by calculating interest on the opening balance instead of the average balance.
If the loop is accidental, correct the formula. If it is intended, confirm it is controlled, as described next.
Iterative calculation
Excel can calculate a loop by repeating the calculation until the results settle. This is iterative calculation. You enable it under File, Options, Formulas, Enable iterative calculation. Two settings control it:
- Maximum Iterations: how many times Excel recalculates. The default is 100.
- Maximum Change: the size of change under which Excel stops. The default is 0.001.
Iterative calculation is a workbook-level behavior in practice, because Excel applies the setting of the first workbook opened in a session. This causes a real hazard: a colleague opens a model with iteration on, then opens yours with iteration off, and the loop is silently evaluated under the wrong setting or flagged as an error.
The risk of turning iteration on to remove the warning
Enabling iteration makes the warning disappear. It does not make the loop correct. With iteration on, an accidental loop is also calculated without any alert, so a typo that creates a loop stops being visible. This is the main reason auditors treat "iterative calculation is enabled" as a finding in itself, even when the model works.
Controlling an intended circularity
A well-built financing loop has a circuit breaker: a switch that cuts the loop so the model can recover from errors. This matters because an error value inside a loop feeds back into itself. Once a #VALUE! or #DIV/0! enters the cycle, it never leaves, even after you fix the cause. The model is stuck until you break the loop by hand.
A common design uses a switch cell on the assumptions sheet. Suppose Circ_Switch holds 1 for on and 0 for off, and Avg_Debt is the average of opening and closing debt:
=IF(Circ_Switch=1, Rate * Avg_Debt, Rate * Opening_Debt)When the switch is 0, interest uses opening debt, which has no dependency on current-period cash flow. The loop is broken, errors clear, and you can set the switch back to 1.
To reset a stuck model:
- Set the switch to 0 and let the model recalculate.
- Confirm that errors have cleared and the checks show OK.
- Set the switch to 1.
- Confirm that the checks still show OK and values have settled.
Checking that a loop has converged
A loop that is iterating may not settle. When you audit an intended circularity, confirm the following.
- The switch is present, labeled, and works in both positions.
- The balance sheet check equals 0 with the switch on and off.
- Results change very little between recalculations. Press F9 several times and watch key cells, such as ending cash, in the Watch Window.
- Maximum Iterations and Maximum Change are documented and sensible.
You can add a visible flag next to the switch. This one reports an imbalance only when the loop is active:
=IF(Circ_Switch=1, IF(ABS(Check_Balance)>0.01, "NOT CONVERGED", "Converged"), "Loop off")Removing a circularity
If the loop adds little value, remove it. These approaches work for most financing loops.
- Use opening balances. Calculate interest on the opening debt or cash balance. This is simpler, easier to audit, and slightly less precise.
- Use a prior-period reference. For a sweep, base repayment on cash available before the current period's interest, with interest calculated on the opening balance.
- Use an algebraic solution. For simple cases, solve the loop with a closed-form formula so no iteration is needed.
- Use a copy-paste macro. Some models paste a computed value into a static cell. This approach is fragile and creates a hardcode, so document it and check it carefully.
Removing the loop usually makes the model more robust, and later reviewers will not need to question the iteration setting.
Common mistakes
- Trusting the status bar address as the cause. It names one cell in the loop. Trace the whole path.
- Fixing the warning, not the cause. Turning on iteration or zeroing a cell hides the problem.
- Forgetting other sheets. The status bar reports only the active sheet. Check each sheet.
- Leaving errors in a live loop. Errors self-perpetuate. Break the loop first, then fix the source.
- Mixing the iteration setting across files. Open the model first in a fresh session, or note the required setting on the cover sheet.
- Counting the loop as the only finding. A loop through interest often sits next to other problems, such as hardcoded overrides in the debt schedule. Run the other checks as well.
Recording the finding
Add each loop to your findings log with enough detail for someone else to reproduce it.
| Field | Example entry |
|---|---|
| Location | IS!D18 (interest expense) |
| Path | D18, D30, CF!D8, CF!D25, BS!D5, D17, D30 |
| Type | Indirect, financing |
| Intended | Yes, documented on Assumptions!C9 |
| Controls | Circ_Switch present; iteration on with 100 and 0.001 |
| Severity | Low if controlled, high if undocumented |
| Action | Document the setting on the cover sheet |
Exercise
A model shows "Circular References: F42" in the status bar. You enable iterative calculation and the warning disappears. The balance sheet check still shows 0. Is the model now safe, and what should you do next?
Show answer
No. Enabling iteration only hides the warning, and the zero check does not prove the loop is intended. Go to F42, use Trace Precedents and Trace Dependents to find every cell in the loop, and write down the path. If the loop is accidental, such as a range that includes its own cell, correct the formula and turn iteration off. If it runs through interest, cash, or debt, confirm there is a labeled circuit breaker switch, test the checks with the switch on and off, and record the iteration settings and the finding in the log.
Exercise
Interest expense is calculated as =Rate*AVERAGE(Opening_Debt, Closing_Debt), and closing debt depends on net income. Write a formula that lets the user cut the loop with a switch named Circ_Switch, and explain why the switch is needed.
Show answer
Use =IF(Circ_Switch=1, Rate*AVERAGE(Opening_Debt, Closing_Debt), Rate*Opening_Debt). With the switch at 0, interest depends only on the opening balance, so the loop is broken. The switch is needed because an error value inside a loop feeds back into itself and stays after the cause is fixed. Setting the switch to 0 clears the error, and setting it back to 1 restores the average-balance calculation.