Sub topic 7
Adding a Circuit-Breaker Switch
This chapter assumes you can build a debt schedule, calculate cash flow available for debt service (CFADS), and use Excel functions such as IF, MIN, MAX, and AVERAGE. You should also understand that a circular reference occurs when a formula depends on its own result through another formula.
Why a circuit breaker is needed
Average-balance interest creates a circular reference in a cash-sweep debt schedule:
- Interest depends on the average of opening and closing debt.
- Closing debt depends on repayment.
- Repayment depends on CFADS after interest.
- Therefore, interest depends indirectly on itself.
Excel can solve this loop with iterative calculation. However, a model needs a controlled way to turn the loop off. A circuit breaker is an input switch that replaces the circular formula with a non-circular formula.
The switch is usually a clearly labeled cell:
| Input | Value | Meaning |
|---|---|---|
| `Circ_Switch` | 1 | Use average-balance interest |
| `Circ_Switch` | 0 | Use opening-balance interest |
A value of 0 is useful during model construction, debugging, and error recovery. It breaks the dependency chain so that Excel can recalculate the schedule without relying on the circular solution.
Building the switch into the debt schedule
Use the switch in the interest formula. When the switch is 1, calculate interest on average debt. When it is 0, calculate interest on opening debt.
Circ_Switch (input cell): 1 = average balance, 0 = opening balance (breaker)
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 - RepaymentWith Circ_Switch set to 1, Interest uses Debt_Close. Debt_Close uses Repayment, and Repayment uses Interest. The circular reference is active.
With Circ_Switch set to 0, Interest uses only Debt_Open. Repayment can then calculate without waiting for a circular result. Debt_Close also calculates normally.
The switch must be a deliberate model input, not a hidden constant inside a formula. Place it near other control inputs, label both possible values, and make the cell visually distinct. A reviewer should be able to see whether the reported result uses the circular or breaker mode.
Operating the switch safely
Before enabling iteration, set the switch to 0. This gives the model a valid starting state. Check that the debt schedule, cash flow statement, and balance sheet calculate without errors.
Then set the switch to 1 and enable iterative calculation in the spreadsheet settings. Configure a maximum number of iterations and a small maximum change, sometimes called the convergence tolerance. Excel repeats the formulas until changes fall below that tolerance or the iteration limit is reached.
The switch does not make an invalid circular model valid. It only provides a controlled alternate calculation path. If the average-balance version produces errors, return the switch to 0, investigate the non-circular schedule, and then test the circular version again.
Debugging a loop with the breaker
Errors can become stuck in a circular calculation. For example, a bad reference, negative debt balance, or invalid input may cause one iteration to return an error. Later iterations can continue using that error, making the model appear permanently broken.
Use this recovery sequence:
- Set
Circ_Switchto0. - Recalculate the workbook.
- Check
Interest,Repayment, andDebt_Closefor errors. - Correct invalid references or inputs.
- Confirm that the opening-balance schedule works.
- Set
Circ_Switchto1. - Recalculate and check that the circular result converges.
A useful check compares the switch with the intended mode. For example, a warning can display when the model is expected to use average-balance interest but Circ_Switch is still 0.
How the control works
The breaker path is intentionally simpler than the circular path. It is a fallback calculation, not necessarily the preferred economic assumption. The average-balance method may be more accurate, but the opening-balance method remains valuable for testing and recovery.
Exercise
What should you do first if the circular debt schedule contains persistent errors?
Show answer
Set Circ_Switch to 0, recalculate, and fix errors in the non-circular opening-balance schedule before enabling the circular calculation again.