Compounding with monthly contributions
Compounding is simple until contributions enter. Money that arrives each month has been invested for a different length of time, so a single exponent cannot give the answer.
Roll it one month at a time
The accurate way is monthly. This month's balance = last month's balance × (1 + monthly rate) + this month's contribution. Repeat that line 240 times and you have the balance after twenty years.
That is exactly what a FlowSim series node does: start value, per-period addition, rate, number of periods, and the last value is the node's value.
The advantage is that anything can be varied: a larger contribution, a rate that changes, or a pause in contributions all fit the same structure.
Two ways to turn an annual rate into a monthly one
Divide by twelve (5% ÷ 12 = 0.4167%), or take the twelfth root ((1.05)^(1/12) − 1 = 0.4074%).
Dividing gives a nominal annual rate: 0.4167% a month actually compounds to 5.116% over a year. The twelfth root makes the effective annual rate exactly 5%.
Deposits usually quote a nominal rate together with a payment frequency, so read the frequency to know what actually accrues. The FlowSim series node divides the annual rate by twelve.
| Quotation | Monthly rate | Effective annual |
|---|---|---|
| Nominal 5%, monthly compounding | 0.4167% | 5.116% |
| Effective 5%, monthly compounding | 0.4074% | 5.000% |
| Nominal 5%, annual compounding | — | 5.000% |
| Nominal 5%, daily compounding | 0.0137% | 5.127% |
Splitting principal from gain
Tax needs the gain, which is final balance minus principal, where principal = starting capital + contribution × months.
In nodes that is one multiply, one add and one subtract. Seeing each value separately makes principal and gain obvious, and a tax node extends the chain to the after-tax gain.
Watch the timing of contributions. Contributing at the start of a month earns that month's interest; contributing at the end does not, and over twenty years the difference is not small. FlowSim adds the contribution after the period's interest.
balance = start
for month in range(1, periods + 1):
balance = balance * (1 + annual_rate / 100 / 12) + monthly_add
# principal = start + monthly_add * periods
# gain = balance - principal
A worked example
Start with 10,000,000, add 500,000 a month at 5% for 240 months. Principal is 10,000,000 + 500,000 × 240 = 130,000,000. The compounded balance is about 232,643,000, roughly 1.79 times the principal.
The interesting number is the gain of about 102,643,000 — close to the 120,000,000 contributed, with nearly half of it (about 46%) earned in the last sixty months. The series chart shows that concentration as a steepening curve.
The series chart shows it directly: the curve looks almost straight early on and steepens towards the end.
Common mistakes
Forgetting to divide the rate by 100 turns a 5× balance into a 6× one. Mixing units — a monthly rate with a period count in years — computes only a fraction of the horizon.
Whether the contribution is added before or after interest changes the result by one month of interest, every month. Either choice is fine as long as the formula and the explanation agree.
Questions
What if the rate changes?
Split the horizon into segments and chain series nodes, feeding each segment's last balance into the next segment's start.
What if contributions stop?
Use a segment with an addition of zero, or supply the per-period addition explicitly for each period.
Sources
Every calculation here can be reproduced with a template in the simulator.
Open the simulator