Sub topic 8
Clearing Errors Stuck in the Loop
Assume you can build a basic debt schedule and understand CFADS (cash flow available for debt service), interest, repayment, and closing debt. This chapter focuses on a circular schedule that has stopped calculating because an error entered the loop.
Why an error remains stuck
In a circular schedule, each value depends on another value from the same calculation chain:
- Interest depends on the debt balance.
- Repayment depends on cash after interest.
- Closing debt depends on repayment.
- Average-balance interest depends on closing debt again.
If one formula returns an error, later formulas pass that error around the loop. Recalculation does not fix the problem because every new iteration starts with the same invalid value.
Common causes include:
- A rate or balance contains text instead of a number.
- A required input is blank.
- A formula divides by zero.
- A repayment formula creates an invalid negative balance.
- A copied formula refers to the wrong period.
- A circuit-breaker cell contains an unexpected value.
- Iterative calculation is disabled or configured with an unsuitable limit.
Use the circuit breaker first
A circuit breaker temporarily replaces average-balance interest with opening-balance interest. This breaks the dependency between interest and closing debt.
Interest: =IF(Circ_Switch=1,Rate*AVERAGE(Debt_Open,Debt_Close),Rate*Debt_Open)
Repayment: =MIN(Debt_Open,MAX(0,CFADS-Interest))
Debt_Close: =Debt_Open-RepaymentSet Circ_Switch to 0. The schedule should then use opening-balance interest and calculate without circularity. If it still shows an error, the problem is not the circular loop alone. Inspect the inputs and formulas in the non-circular path.
Once the error is fixed, set Circ_Switch back to 1 and recalculate. Do not leave the switch at 0 without recording that the schedule is using the fallback method.
A controlled debugging sequence
Use this sequence when an error does not clear:
- Record the error type and the affected period.
- Set
Circ_Switchto0. - Recalculate the workbook.
- Trace the formulas for interest, repayment, and closing debt.
- Check that rates, balances, and CFADS are numeric.
- Check for zero denominators and invalid period references.
- Confirm that repayment is limited to the opening debt.
- Re-enable the circular method.
- Recalculate again and check the residual difference.
In Excel, a full recalculation can be forced with Ctrl+Alt+F9. Use this after correcting an input when displayed values may be stale. If the workbook has stored an error in a circular chain, changing the breaker and forcing a full recalculation gives the formulas a clean, non-circular path.
Diagnose the pattern, not only the cell
| Symptom | Likely cause | First check |
|---|---|---|
| `#VALUE!` | Text in a numeric input | Rate, CFADS, and debt cells |
| `#DIV/0!` | Zero or blank denominator | Fee, coverage, or ratio formula |
| `#NUM!` | Invalid iterative result | Rate and repayment limits |
| Circular warning | Loop is active without iteration | Calculation settings and breaker |
| Debt becomes negative | Repayment is not capped | `MIN(Debt_Open, ...)` |
A single error in an earlier period can also affect every later period. Start with the first period showing an error, not the last cell displaying one.
Follow the error path
Confirm the repair
After restoring average-balance interest, verify both the calculation and the accounting identity:
- Interest is numeric and has the expected sign.
- Repayment is between zero and opening debt.
- Closing debt equals opening debt minus repayment.
- The switch has the intended value.
- The change in interest between iterations falls below the workbook tolerance.
- No error appears in any period.
A repaired model should also behave sensibly when you change the rate or CFADS. If a small input change produces a huge jump or a new error, inspect the affected branch before relying on the output.
Exercise
A circular debt schedule shows #VALUE!. Setting Circ_Switch to 0 makes the schedule calculate. What should you do next?
Show answer
Trace the average-balance interest path, check that the rate and debt values are numeric, force a full recalculation, then restore Circ_Switch to 1 and verify the roll-forward and convergence.