Sub topic 3
Calculating interest: opening, closing, and average balances
This chapter assumes you can build a balance roll-forward (opening balance, movements, closing balance) and that you understand simple and compound interest. You should also be comfortable with a spreadsheet formula or a short Python function. It covers one question: which balance do you multiply by the rate to get a period's interest expense?
Why the choice matters
A loan balance usually changes during a period. A repayment, a revolver draw, or a cash sweep all move it. The interest charge depends on how long each dollar was outstanding. A model that only sees period-end snapshots has to approximate that. Three approximations are common:
- Opening balance: interest = opening balance × rate. This ignores every movement in the period.
- Closing balance: interest = closing balance × rate. This assumes every movement happened on the first day.
- Average balance: interest = (opening + closing) / 2 × rate. This assumes movements happen evenly through the period.
The rate here is the rate for one period. For an annual model it is the annual rate. For a quarterly model it is the annual rate scaled to a quarter (see the day count section).
A worked comparison
Take a 1,000 term loan at 10% that repays 200 per year. Each period's interest depends on the method.
| Year | Opening | Closing | Interest on opening | Interest on closing | Interest on average |
|---|---|---|---|---|---|
| 1 | 1,000 | 800 | 100 | 80 | 90 |
| 2 | 800 | 600 | 80 | 60 | 70 |
| 3 | 600 | 400 | 60 | 40 | 50 |
| 4 | 400 | 200 | 40 | 20 | 30 |
| 5 | 200 | 0 | 20 | 0 | 10 |
| Total | 300 | 200 | 250 |
The opening method gives the highest interest because the balance only falls. The closing method gives the lowest. The average method lands between them.
The same logic in Python:
def interest_on(method, opening, closing, rate):
if method == "opening":
base = opening
elif method == "closing":
base = closing
elif method == "average":
base = (opening + closing) / 2
else:
raise ValueError(f"unknown method: {method}")
return base * rate
balance = 1000.0
rate = 0.10
repayment = 200.0
totals = {"opening": 0.0, "closing": 0.0, "average": 0.0}
for year in range(1, 6):
opening = balance
closing = balance - repayment
row = {m: interest_on(m, opening, closing, rate) for m in totals}
for m, value in row.items():
totals[m] += value
print(year, opening, closing, {m: round(v, 2) for m, v in row.items()})
balance = closing
print({m: round(v, 2) for m, v in totals.items()})
# {'opening': 300.0, 'closing': 200.0, 'average': 250.0}When each method is right
No method is correct in general. Each one matches a particular timing assumption.
The practical trade-offs are these:
| Method | Assumes | Strength | Weakness |
|---|---|---|---|
| Opening | Movements at period end | Simple and never circular | Overstates interest when the balance falls and understates it when the balance rises |
| Closing | Movements at period start | Simple | Rarely matches reality, and is circular when the closing balance depends on cash flow after interest |
| Average | Movements evenly spread | Best approximation for most loans | Creates a circular reference when repayments depend on cash flow after interest |
A level-payment loan with payments on the last day of each period is a special case. The opening balance is then exactly right, because the balance does not change until the payment date. The annuity schedule you will build in the repayment profiles chapter uses interest on the opening balance for this reason.
The average method has its own limit. It is exact only when movements are spread evenly. A single large repayment on day 10 of a 365-day year is not well described by the average.
Why the average method can be circular
Suppose a cash sweep repays whatever cash is left after paying interest. The chain is:
- Interest depends on the average balance.
- The average balance depends on the closing balance.
- The closing balance depends on the sweep.
- The sweep depends on cash after interest, so it depends on interest.
Interest depends on itself. A spreadsheet reports a circular reference, and a script has to loop. A later chapter covers the circuit-breaker switch and iteration. For now, notice that the circularity comes from pairing average-balance interest with repayments that depend on interest. A fixed schedule, such as a level 200 per year, is not circular, as the Python example shows.
Day count conventions
A rate is quoted per year, but a period may be a month, a quarter, or a stub. The day count convention says how to convert the annual rate into the period's fraction. The usual conventions are:
- Actual/360: actual days in the period divided by 360. It is common for loans and money-market rates, and it charges slightly more than a calendar year implies.
- Actual/365: actual days divided by 365.
- 30/360: every month counts as 30 days and every year as 360. A month is always 1/12 of a year.
The same loan costs a different amount under each convention. This function computes the year fraction, using the US 30/360 rule in a simplified form:
from datetime import date
def year_fraction(start, end, convention):
if convention == "act/360":
return (end - start).days / 360
if convention == "act/365":
return (end - start).days / 365
if convention == "30/360":
d1 = min(start.day, 30)
d2 = end.day
if d2 == 31 and d1 == 30:
d2 = 30
days = (360 * (end.year - start.year)
+ 30 * (end.month - start.month)
+ (d2 - d1))
return days / 360
raise ValueError(f"unknown convention: {convention}")
start, end = date(2026, 3, 1), date(2026, 4, 1)
balance, rate = 1_000_000, 0.06
for convention in ("act/360", "act/365", "30/360"):
fraction = year_fraction(start, end, convention)
print(convention, round(balance * rate * fraction, 2))
# act/360 5166.67
# act/365 5095.89
# 30/360 5000.0The period from 1 March to 1 April has 31 actual days. Under 30/360 it is exactly one month. The differences are small per period but compound into real money on a large facility.
Edge cases
- Drawdown on the first day. A loan drawn at closing has an opening balance of zero in the first period. Interest on the opening balance would then be zero. Treat the drawdown as an opening movement, or use the average balance, so the first period carries interest.
- Balance that rises. A revolver draw increases the closing balance. The opening method then understates interest, so the error runs in the opposite direction from a term loan.
- Stub periods. A first period shorter than a full year needs the period's year fraction, not a full year's rate. Use the day count formula above.
- Interest paid in kind (PIK). If interest is added to the balance instead of paid in cash, the interest becomes a movement in the roll-forward. Interest on the average balance then depends on a movement that depends on interest, so it is circular again.
- Zero or negative balance. An overpaid facility would produce negative interest. Cap the closing balance at zero, as the cash sweep does, or wrap the base in
max(0, ...).
Exercise
A loan opens the year at 500 and closes at 400 after a single repayment of 100. The annual rate is 8%. Compute the interest under the opening, closing, and average methods, and say which method fits a repayment made on the last day of the year.
Show answer
Opening: 500 × 8% = 40. Closing: 400 × 8% = 32. Average: (500 + 400) / 2 × 8% = 450 × 8% = 36. A repayment on the last day of the year means the full 500 was outstanding all year, so the opening method (40) is the right one.
Exercise
Why does interest on the average balance create a circular reference in a model with a cash sweep, but not in a model with a fixed 200-per-year repayment?
Show answer
With a sweep, the repayment depends on cash after interest, and interest depends on the average balance, which depends on the repayment. The loop closes. With a fixed repayment, the closing balance is known before interest is calculated, so interest can be computed in one pass.