Sub topic 10
Giving credit for what you already have
This chapter assumes you can compute the nest egg target from earlier chapters and know the future value of an annuity formula. Monthly contributions grow into a lump sum. Money you already hold also grows into a lump sum, and the monthly target only has to cover the part of the goal that the existing money won't reach. This chapter covers how to credit that money, which balances to count, and what can go wrong.
The idea: grow the balance, then subtract it
Suppose your target is $1,200,000 in future dollars and you have $50,000 saved. You could subtract $50,000 from the target and solve for the rest. That is wrong, because the $50,000 will not stay at $50,000. It compounds for as many years as you have left.
The correct order has three steps:
- Grow today's balance to the retirement date at the assumed return.
- Subtract that future value from the target. The result is the gap.
- Solve for the level monthly contribution that fills the gap.
The existing balance grows by the compounding factor:
balance_future = balance_today × (1 + r)^n
Here r is the monthly rate (annual return divided by 12) and n is the number of months. The gap is target − balance_future. The monthly contribution is the gap divided by the annuity factor ((1 + r)^n − 1) / r.
A worked example
Use these inputs: a target of $1,200,000, 25 years, a 6% nominal annual return, and $50,000 saved.
- Monthly rate: 0.06 / 12 = 0.005.
- Months: 25 × 12 = 300.
- Growth factor: 1.005^300 is about 4.465.
- The $50,000 grows to about $223,200.
- Gap: $1,200,000 − $223,200 = about $976,800.
- Annuity factor: (4.465 − 1) / 0.005 is about 693.
- Monthly contribution: $976,800 / 693 is about $1,409.
With no existing savings, the contribution would be $1,200,000 / 693, or about $1,732. The $50,000 head start lowers the monthly target by roughly $322. Existing savings did about 19% of the work, since $223,200 is 18.6% of the target.
Code: crediting a balance and checking the result
The functions below are the closed-form solver and the month-by-month simulation. The script adds up several accounts, solves for the monthly amount, and then confirms by simulation that the plan reaches the target.
import math
def monthly_saving(target, years, annual_return, current_balance=0.0):
"""Level monthly contribution, paid at the end of each month, that reaches target."""
n = years * 12
r = annual_return / 12
balance_future = current_balance * (1 + r) ** n
gap = max(target - balance_future, 0.0)
if r == 0:
return gap / n
return gap * r / ((1 + r) ** n - 1)
def simulate(monthly, years, annual_return, balance=0.0, annual_raise=0.0):
"""Month-by-month balance with end-of-month contributions that rise once a year."""
r = annual_return / 12
for month in range(years * 12):
if month > 0 and month % 12 == 0:
monthly *= 1 + annual_raise
balance = balance * (1 + r) + monthly
return balance
def required_balance_today(target, years, annual_return):
"""Balance that grows to the target with no new contributions."""
return target / (1 + annual_return / 12) ** (years * 12)
accounts = {"401k": 32_000, "IRA": 12_000, "Brokerage": 6_000}
existing = sum(accounts.values())
target, years, ret = 1_200_000, 25, 0.06
with_credit = monthly_saving(target, years, ret, existing)
without_credit = monthly_saving(target, years, ret)
check = simulate(with_credit, years, ret, balance=existing)
assert math.isclose(check, target, rel_tol=1e-9)
print(f"With credit: {with_credit:,.0f} per month")
print(f"Without credit: {without_credit:,.0f} per month")
print(f"Balance that needs no more saving: {required_balance_today(target, years, ret):,.0f}")The script prints about $1,409 per month with credit and $1,732 without. It also prints the balance at which you could stop saving entirely, about $268,800 in this example. The assertion passes because the simulation uses the same timing and rate as the formula. If you change one without the other, the assertion fails, which is the point of the check.
How much credit depends on time
Compounding rewards time, so the same balance is worth more the longer you have. At a 6% return, $50,000 grows as follows:
| Years to retirement | Growth factor | $50,000 becomes (approx.) |
|---|---|---|
| 10 | 1.82 | $91,000 |
| 20 | 3.31 | $165,500 |
| 25 | 4.46 | $223,200 |
| 30 | 6.02 | $301,100 |
Two practical consequences follow:
- A balance matters most to someone with a long horizon. A 30-year-old with $50,000 has already covered a large slice of the goal. A 58-year-old with the same balance has covered a small one.
- The credit is a forecast, not a fact. A large existing balance makes your plan more dependent on the return assumption, because the balance compounds for the whole horizon.
Which balances to count
The formula accepts any number, so the judgment about what to include is yours.
- Count money earmarked for retirement. This includes employer plan balances, individual retirement accounts, and a taxable brokerage account you will not spend before retirement.
- Leave out money with another job. An emergency fund, a house down payment, and a child's tuition fund are already spoken for. Counting them twice makes the monthly target look smaller than it is.
- Be careful with home equity. It counts only if you plan to sell or borrow against it for retirement spending. If you will live in the house, it already supports your spending by removing rent. Credit it only if your spending estimate assumed no housing cost.
- Match the tax treatment. A pre-tax balance of $100,000 is not worth $100,000 of spending, because withdrawals are taxed as income. Your target nest egg must be on the same basis as the balances. If the target is a before-tax figure, add the balances as they are. If the target is after tax, convert pre-tax balances to after-tax amounts first. The account types chapter covers this in more detail.
- Use the current balance, not the balance you hope to have. If you plan to roll over an old plan, include it. If you plan to inherit, do not.
Edge cases
The balance already exceeds the target. The gap becomes negative, and max(..., 0.0) clamps it to zero, so the function returns 0. That tells you no new contributions are required under the assumptions. It does not mean you should stop saving. A zero result leaves no margin for a bad return, so stress-test it before relying on it.
The return is zero. The annuity formula divides by r, so the code handles r == 0 as a special case. The balance does not grow, and the gap is spread evenly over n months.
The horizon is very short. With only a year or two left, (1 + r)^n − 1 is small, and a small error in the balance or return changes the monthly amount a lot. For short horizons, treat the output as a rough guide.
Contributions already in progress. If you already contribute, for example through an employer plan, you can leave those contributions out of the existing balance and treat the formula's output as the total monthly amount needed. Employer match is part of that total. A match lowers what you personally contribute, but the formula counts it as an inflow like any other.
Timing of the balance. The balance is measured today, and contributions start at the end of this month. If you update the balance after several months of saving, recalculate from the new balance and the shorter horizon. Do not subtract your past contributions from an old plan.
Common errors
- Subtracting the balance from the target without growing it. This overstates the monthly need.
- Growing the balance for a different number of months than the contributions. Both must use the same
n. - Counting an account that is also in the spending plan, such as a fund you will draw down before retirement.
- Mixing real and nominal rates between the balance and the target.
- Treating the output as exact. It is a calculation under assumptions, and the sensitivity chapter shows how far it can move.
Exercise
You have $100,000 saved, a target of $300,000, 10 years to go, and you assume a 0% return. What monthly contribution is needed, and what does monthly_saving return if the balance is $350,000 instead?
Show answer
With a 0% return, the balance stays at $100,000, so the gap is $200,000. The function spreads it over 120 months: 200,000 / 120 = about $1,666.67 per month. With a $350,000 balance, the grown balance exceeds the target, the gap is clamped to zero, and the function returns 0.0.
Exercise
Someone with a 25-year horizon and a 6% return has $50,000 in a retirement account and a $20,000 fund for a house down payment in two years. They add both and pass $70,000 as current_balance. Name the mistake and its effect on the monthly target.
Show answer
The down payment fund is committed to another goal and will be spent long before retirement, so it should not be credited. Passing $70,000 grows money that will not be there, so the grown balance is too high and the monthly target comes out too low. Pass only the $50,000 retirement balance.