Compounding happens when growth stays invested and contributes to future gains or losses. Time gives that process more opportunities to work.
Follow the balance, year by year
At a hypothetical constant 5% return, $10,000 becomes $10,500 after a year. A second 5% return earns $525 because it applies to the new balance. After two years the balance is $11,025. The formula for one deposit is starting balance multiplied by (1 + annual return) raised to the number of years.
Give each contribution its own timeline
Money you invest this month compounds for longer than money you invest next year. To model recurring deposits, convert an effective annual rate to a monthly rate and apply the growth before each month-end contribution. This also works at a zero return, when the future balance is simply your starting balance plus total deposits.
Separate deposits from investment gains
A portfolio may be larger because you saved more, markets rose, or both. Compare the ending balance against total contributions to see the modeled gain. Then adjust the ending balance for inflation to understand how much it might buy.
Try different returns and costs
A smooth line is a mathematical scenario. Market returns change and can be negative over extended periods. Fund expenses reduce what stays invested, so use a return after fees. Try different saving amounts and lower return assumptions before you build a goal around one estimate.