Sub topic 2
How a Cash Sweep Feeds Interest Back into the Balance
This chapter assumes you can build a debt schedule in a spreadsheet and know the cash flow waterfall: cash flow available for debt service (CFADS), then interest, then repayment. It also assumes you are comfortable with IF, MIN, MAX and AVERAGE. The previous chapter showed that interest circularity exists. This chapter shows the mechanism that creates it, which is the cash sweep and the revolver.
What a cash sweep does
A cash sweep is a rule that sends surplus cash to repay debt instead of letting it build up on the balance sheet. Whatever cash remains after interest, mandatory repayments and any minimum cash balance goes to the lender. A revolver (revolving credit facility) works in the other direction. When cash falls short, the model draws on the revolver. When cash is in surplus, the model repays the revolver first.
Both are plugs. Neither amount is an input. The model calculates each one from the cash left over, so both depend on every cash item above them in the waterfall, and interest is one of those items.
The loop in one period
Take a term loan with these figures:
- Opening balance: 500
- CFADS (cash before interest): 100
- Interest rate: 8%
- 100% of surplus cash is swept
Interest is charged on the average balance. The sweep is CFADS minus interest. The closing balance is the opening balance minus the sweep. Each quantity needs the next one:
Follow the arrows from interest. Interest reduces the cash available for the sweep. The sweep sets the closing balance. The closing balance sets the average balance, and the average balance sets interest. The chain returns to its starting cell, so the spreadsheet has no cell it can calculate first.
Two properties of the loop matter:
- It only exists with average-balance interest. If interest uses the opening balance, the arrow from the closing balance to the average balance disappears, and so does the loop.
- It is a real economic relationship, not a modelling quirk. In reality, interest accrues on the balance outstanding through the period, and that balance is reduced by cash that is only available after paying interest. The circularity reflects that simultaneity.
Watching the feedback pass by pass
Before you let Excel solve the loop, it helps to see what the feedback does. The script below starts with zero interest and repeats the waterfall. It uses the same figures as the example above.
opening, cfads, rate = 500.0, 100.0, 0.08
interest = 0.0
print("pass interest repayment closing")
for k in range(1, 6):
repayment = min(opening, max(0.0, cfads - interest))
closing = opening - repayment
interest = rate * (opening + closing) / 2
print(f"{k:>4} {interest:8.4f} {repayment:9.4f} {closing:8.4f}")Each row shows the repayment that was based on the previous interest figure, the closing balance that follows from it, and the interest recalculated from that balance:
| Pass | Interest | Repayment used | Closing balance |
|---|---|---|---|
| 1 | 36.0000 | 100.0000 | 400.0000 |
| 2 | 37.4400 | 64.0000 | 436.0000 |
| 3 | 37.4976 | 62.5600 | 437.4400 |
| 4 | 37.4999 | 62.5024 | 437.4976 |
| 5 | 37.5000 | 62.5001 | 437.4999 |
The sequence settles at interest of 37.5, a sweep of 62.5 and a closing balance of 437.5. Check it: 8% of the average of 500 and 437.5 is 8% of 468.75, which is 37.5. Each pass shrinks the error by a factor of 0.04, which is half the interest rate. The convergence chapter explains why. For now, notice that a higher rate would make the gap shrink more slowly.
Pass 1 shows the typical first-iteration error. With interest at zero, the model sweeps all 100 of CFADS, which overstates the repayment by 37.5 and understates the closing balance. The feedback then corrects the figure.
Building the sweep and revolver in a spreadsheet
A realistic schedule has a mandatory amortization, a minimum cash balance, a revolver and a sweep. The order of the waterfall matters, and each step uses MIN and MAX to stop a balance going negative or above a limit.
Cash_Pre_Revolver: =Cash_Open + CFADS - Total_Interest - Mandatory_Repay - Min_Cash
Revolver_Draw: =MIN(Facility_Limit - Rev_Open, MAX(0, -Cash_Pre_Revolver))
Revolver_Repay: =MIN(Rev_Open, MAX(0, Cash_Pre_Revolver))
Cash_For_Sweep: =MAX(0, Cash_Pre_Revolver - Revolver_Repay)
Sweep: =MIN(TL_Open - Mandatory_Repay, Sweep_Pct * Cash_For_Sweep)
TL_Close: =TL_Open - Mandatory_Repay - Sweep
Rev_Close: =Rev_Open + Revolver_Draw - Revolver_Repay
Total_Interest: =TL_Rate*AVERAGE(TL_Open, TL_Close) + Rev_Rate*AVERAGE(Rev_Open, Rev_Close)Read the dependencies in the order written:
Cash_Pre_RevolverusesTotal_Interest.- The revolver and sweep rows use
Cash_Pre_Revolver. - The closing balances use the revolver and sweep rows.
Total_Interestuses the closing balances.
That closes the loop through four hops instead of three. Adding a second tranche or a cash interest income line adds more hops but does not change the structure.
Why the revolver and the sweep are linked
The revolver repayment comes before the sweep in the waterfall. A company with a drawn revolver pays that down first, and only the remainder sweeps the term loan. Since the revolver and the term loan both feed into Total_Interest, one cash shortfall in a period can move both closing balances and both interest charges at once.
The sign of Cash_Pre_Revolver decides which branch is active:
| `Cash_Pre_Revolver` | Revolver | Sweep |
|---|---|---|
| Negative | Draws the shortfall, up to the limit | Zero |
| Zero or positive, revolver drawn | Repays from the cash | Gets only what is left |
| Positive, revolver undrawn | No activity | Gets the whole surplus, up to the loan balance |
Common errors in sweep logic
Most errors in these structures come from the waterfall rather than from the circularity itself.
- Sweeping cash that is not there. If
Cash_For_Sweepomits theMAX(0, ...)guard, a cash shortfall produces a negative sweep, which increases the loan balance. The model then borrows from the term loan without any lender agreeing to it. - Drawing and repaying the revolver in the same period. A negative
Cash_Pre_Revolvershould give a draw and no repayment. Both formulas use the same signed cash figure, so check that one uses-Cash_Pre_Revolverand the other usesCash_Pre_Revolver. - Ignoring the facility limit. Without
Facility_Limit - Rev_Openin the draw formula, the revolver can fund any shortfall. If the limit binds, cash must fall below the minimum, and the model should show that. - Sweeping before mandatory repayment. The sweep cap must use the balance after the mandatory repayment. Otherwise the closing balance can go below zero.
- Using the closing balance for interest in one place and the average in another. If the income statement and the debt schedule disagree on the interest basis, the cash flow statement will not reconcile to the balance sheet.
Why the nonlinear limits matter
In the single-period example, no limit is active. The sweep equals CFADS minus interest, so the system is linear, and a closed-form solution exists. Once MIN or MAX terms start binding, the relationship between interest and closing balance changes shape from period to period. This means:
- A formula that is exact in one scenario is wrong in another, for instance when the loan is fully repaid and the sweep is capped by the balance.
- A scenario sweep over a large range of cash flows can cross from one regime to another, such as revolver drawn, revolver repaid or loan paid off.
- The iteration still converges in these cases because it just applies the formulas as written. That is why iterative calculation is the general method and the algebraic one is a special case.
What the loop does to your model
Knowing the mechanism tells you what to expect when you turn the circularity on:
- Interest is slightly higher than the opening-balance method when debt falls, because the average balance is below the opening balance. Wait, check the direction: average balance is lower than opening balance when debt is repaid, so average-balance interest is lower. In the example, opening-balance interest is 8% of 500, which is 40, against 37.5 for the average method.
- The difference grows with the repayment size, so models with heavy sweeps show the biggest gap between methods.
- Errors spread through the whole loop. A
#DIV/0!or#REF!anywhere on the chain can feed back into itself and stay there even after you fix the source. A later chapter covers clearing it with a circuit breaker.
Exercise
A term loan opens at 200, CFADS is 50, the rate is 10%, and 100% of surplus cash is swept, with interest on the average balance. Start with interest of 0 and do two passes of the loop by hand. What are the interest and closing balance after pass 2?
Show answer
Pass 1 starts with interest 0, so the sweep is 50 and the closing balance is 150. Interest becomes 10% x (200 + 150) / 2 = 17.5. Pass 2 uses interest of 17.5, so the sweep is 50 - 17.5 = 32.5 and the closing balance is 167.5. Interest becomes 10% x (200 + 167.5) / 2 = 18.375. After pass 2, interest is 18.375 and the closing balance is 167.5. The exact answer is 18.4211 (algebraically, interest = 0.1 x (400 - 50) / 2 / 0.95), so the iteration is still converging.
Exercise
In the revolver and sweep formulas above, what goes wrong if Cash_For_Sweep is written as =Cash_Pre_Revolver - Revolver_Repay without the MAX(0, ...) guard, and what does that do to the interest loop?
Show answer
When the company has a cash shortfall, Cash_Pre_Revolver is negative, so the sweep becomes negative and the term loan balance rises as if the company had borrowed more from the term lender. The revolver also draws to cover the same shortfall, so the shortfall is funded twice. The loop still iterates to a stable answer, so no error appears, but the closing balances and interest are wrong. The guard stops the sweep from going below zero.