Sub topic 16
Average-Balance Interest, Revolvers and Circular References
This chapter assumes you can already build the linked model from earlier chapters: net income feeds retained earnings and the cash flow statement, and ending cash feeds the balance sheet. You should also be comfortable with a debt schedule. Here you will see why two common modeling choices make the model refer to itself, and how to handle that.
Where the loop comes from
Two choices create the loop.
- Interest on average balances. Interest is charged on the average of opening and closing debt, not on the opening balance alone. This is more accurate when debt changes during the period.
- A revolver. A revolving credit facility, or revolver, is a borrowing line the model draws on when cash would fall below a minimum and repays when cash is spare. The draw depends on cash before the revolver, and that cash depends on net income.
Combine them and you get a chain:
- Interest depends on the closing revolver balance.
- Net income depends on interest.
- Cash flow from operations depends on net income.
- Cash before the revolver depends on cash flow from operations.
- The revolver draw depends on cash before the revolver.
- The closing revolver balance depends on the draw.
The last item feeds back into the first. Spreadsheets call this a circular reference.
Term debt with scheduled repayments does not cause a loop. Its closing balance is fixed by the schedule, so its average-balance interest is computable directly. Only a balance that responds to cash creates the circularity.
The revolver logic
The revolver formula keeps cash at a minimum level without drawing more than needed:
- Draw (positive) or repayment (negative) = minimum cash minus cash before the revolver.
- A repayment cannot exceed the opening revolver balance, so the draw is floored at the negative of that balance.
In a spreadsheet this is =MAX(MinCash - CashPreRevolver, -RevolverOpen). The result goes in the financing section of the cash flow statement. A draw is a cash inflow, so it has a positive sign there. Closing revolver equals opening revolver plus the draw, and it sits under liabilities on the balance sheet.
Solving the loop by iteration
A circular model has a fixed point: a revolver balance that, once used to compute interest, reproduces itself. You can find it by repeated substitution. Start with a guess (zero is fine), compute everything, take the new revolver balance, and repeat until it stops changing.
This converges quickly here because each loop pass multiplies the change by a small factor. A $1 change in the revolver changes interest by rate × 0.5 = $0.04, after-tax by $0.03, and cash by the same $0.03. The draw therefore changes by about 3% of the previous change on each pass.
The code below extends the one-period model from earlier in the tutorial. It adds a revolver, average-balance interest, and a minimum cash target.
cash_open, ar_open, ppe_open = 100.0, 50.0, 200.0
ap_open, debt_open, equity_open = 30.0, 120.0, 200.0
revolver_open = 0.0
tax_rate, rate = 0.25, 0.08
ebit = 500.0 - 380.0 - 20.0 # revenue - operating costs - depreciation
depreciation, capex = 20.0, 30.0
dividends, debt_repayment = 20.0, 10.0
ar_close, ap_close = 60.0, 35.0
def run(min_cash, max_iter=100, tol=1e-9):
debt_close = debt_open - debt_repayment
revolver_close = revolver_open # first guess
for i in range(1, max_iter + 1):
avg_debt = (debt_open + debt_close) / 2
avg_rev = (revolver_open + revolver_close) / 2
interest = rate * (avg_debt + avg_rev)
net_income = (ebit - interest) * (1 - tax_rate)
cfo = (net_income + depreciation
- (ar_close - ar_open) + (ap_close - ap_open))
cash_pre = cash_open + cfo - capex - debt_repayment - dividends
draw = max(min_cash - cash_pre, -revolver_open)
new_close = revolver_open + draw
converged = abs(new_close - revolver_close) < tol
revolver_close = new_close
if converged:
break
cash_close = cash_pre + draw
assets = cash_close + ar_close + (ppe_open + capex - depreciation)
liabilities = ap_close + debt_close + revolver_close
equity = equity_open + net_income - dividends
assert abs(assets - (liabilities + equity)) < 1e-6
return i, interest, net_income, revolver_close, cash_close
for min_cash in (100.0, 130.0):
i, interest, ni, rev, cash = run(min_cash)
print(f"min cash {min_cash}: iterations={i}, interest={interest:.4f}, "
f"net income={ni:.4f}, revolver={rev:.4f}, cash={cash:.2f}")With a minimum cash of 100, cash before the revolver is 123.1, so no draw is needed. The revolver stays at 0 and the loop converges on the first pass.
With a minimum cash of 130, the model needs a draw. The converged values are:
- Revolver: about 7.1134.
- Interest: about 9.4845.
- Net income: about 67.8866.
- Cash: exactly 130.
Assets are 400, and liabilities plus equity are 152.1134 + 247.8866 = 400. The balance check passes because the loop was solved consistently, not because of a plug.
Checking the answer algebraically
For a single period you can solve the loop in closed form and use it to verify the iterative result. Let D be the draw. Revolver interest is 0.04 × D, so net income falls by 0.03 × D, and cash before the draw falls by the same amount:
- Cash after the draw = 123.1 − 0.03 × D + D = 123.1 + 0.97 × D.
- Setting that equal to 130 gives D = 6.9 / 0.97 ≈ 7.1134, matching the iteration.
Closed-form solutions work for simple cases. They become unwieldy with multiple tranches, cash sweeps, and tax floors, which is why most models iterate.
Handling circularity in a spreadsheet
Modelers use three main approaches.
| Approach | How it works | Trade-off |
|---|---|---|
| Iterative calculation | Enable it in the spreadsheet settings (Excel: File, Options, Formulas, Enable iterative calculation). The application repeats the loop until the change is below a threshold or it hits a maximum count. | Simple to build. Errors can get stuck in the loop. |
| Opening-balance interest | Charge interest on the opening revolver balance only. There is no loop. | Understates interest when the revolver grows. Easy to audit. |
| Algebraic or macro solution | Solve the draw in closed form, or use a macro that copies values until they converge. | No live circularity. More build effort and harder to maintain. |
Add a circuit breaker
An error such as #VALUE! or #DIV/0! that enters a circular loop feeds itself and never clears, even after you fix the cause. Protect against it with a switch cell:
- Add a cell, say
Circ_On, holding 1 or 0. - Compute revolver interest as
=IF(Circ_On=1, Rate * AVERAGE(RevOpen, RevClose), Rate * RevOpen). - If errors appear, set the switch to 0 to flush them out, repair the cause, then set it back to 1.
Edge cases and gotchas
- Convergence is not guaranteed in principle. Here the feedback factor is about 0.03, so it converges fast. A model with very high rates, or with a cash sweep that also feeds back into interest, has a larger factor. If it reaches 1 or more, the iteration diverges. Cap the iterations and check that the final change is under your tolerance.
- A balanced model can still be wrong. If you stop iterating too early, the balance sheet may be off by a small residual. The balance check tells you the loop has not converged, so a small nonzero check is a signal, not noise.
- Interest income on cash. Interest earned on average cash creates a second loop through ending cash. The same fixes apply.
- Sign errors. A revolver draw is a financing inflow and a repayment is an outflow. If you reverse the signs, the loop may diverge and the balance check will fail.
- Do not plug. Forcing cash or the revolver to make the balance sheet balance hides the linking error the check exists to catch.
Exercise
In the model above, the minimum cash is 130 and the revolver draw converges to about 7.1134. Suppose the interest rate rises to 10% on all debt (term loan and revolver), with everything else unchanged. Without running code, write the equation for the revolver draw D, then solve it. Use these figures: EBIT is 100, and the term loan averages 115. Cash before the revolver with zero revolver interest is 100 + ((100 − 0.10 × 115) × 0.75 + 20 − 10 + 5) − 30 − 30.
Show answer
Term-loan interest is 0.10 × 115 = 11.5. Revolver interest is 0.10 × D/2 = 0.05 × D. Net income = (100 − 11.5 − 0.05 × D) × 0.75 = 66.375 − 0.0375 × D. Cash flow from operations = 66.375 − 0.0375 × D + 20 − 10 + 5 = 81.375 − 0.0375 × D. Cash after the draw = 100 + 81.375 − 0.0375 × D − 30 − 30 + D = 121.375 + 0.9625 × D. Setting this equal to 130 gives D = 8.625 / 0.9625 ≈ 8.961. The draw is larger than at 8% because higher term-loan interest reduces cash before the revolver, and the revolver's own interest takes a slightly larger share of each extra dollar drawn.