Sub topic 2
Solving the loop with iterative calculation
This chapter assumes you can build a debt schedule with a cash sweep, write IF, MIN and AVERAGE formulas, and follow the average-balance interest loop from the previous section.
Turning on iterative calculation
Spreadsheets refuse to calculate a circular reference until you allow it. In Excel, open File > Options > Formulas and tick "Enable iterative calculation". Two settings control the process. Maximum Iterations caps the number of passes (100 is typical). Maximum Change sets how small the difference between passes must be before the sheet stops (0.001 is typical).
On each recalculation, the sheet computes interest from the current closing balance, updates the balance, and repeats until the change falls below Maximum Change or the cap is reached.
Why the iteration converges and how fast
Each pass shrinks the error by a fixed factor. For average-balance interest, that factor is half the interest rate. At 8%, the factor is 0.04, so each pass removes about 96% of the remaining error.
Starting from zero interest on a 500 opening balance with 100 of cash available for debt service, the passes produce 36.00, 37.44, then 37.50, settling at 37.5. At a rate of 200%, the factor reaches 1, so the passes stop shrinking the error and the iteration never settles. Rates that high are rare, but a model with an unusual input can hit this case.
Adding a circuit-breaker switch
A circuit breaker is a single input cell that cuts the loop. Name it Circ_Switch and write the interest formula like this:
=IF(Circ_Switch=1, Rate*AVERAGE(Debt_Open, Debt_Close), Rate*Debt_Open)With Circ_Switch set to 1, interest uses the average balance. With it set to 0, interest uses the opening balance, so the loop disappears and any error values stop circulating. Set the switch to 0, let the sheet recalculate, then set it back to 1.
Exercise
With an 8% rate, a 500 opening balance and 100 of cash available for debt service, what is the closing balance once interest settles?
Show answer
Interest settles at 37.5, so the closing balance is 500 − 100 + 37.5 = 437.5.