Dollar-Cost Averaging Calculator Formula
Understand the math behind the dollar-cost averaging calculator. Each variable explained with a worked example.
Formulas Used
Future Value
future_value = monthly_return > 0 ? monthly_investment * (pow(1 + monthly_return, total_months) - 1) / monthly_return : total_investedTotal Invested
amount_invested = total_investedInvestment Gains
investment_gains = (monthly_return > 0 ? monthly_investment * (pow(1 + monthly_return, total_months) - 1) / monthly_return : total_invested) - total_investedTotal Gain
gain_percentage = total_invested > 0 ? ((monthly_return > 0 ? monthly_investment * (pow(1 + monthly_return, total_months) - 1) / monthly_return : total_invested) - total_invested) / total_invested * 100 : 0Variables
| Variable | Description | Default |
|---|---|---|
monthly_investment | Monthly Investment(USD) | 500 |
years | Investment Period(years) | 10 |
annual_return | Expected Annual Return(%) | 8 |
monthly_return | Derived value= annual_return / 12 / 100 | calculated |
total_months | Derived value= years * 12 | calculated |
total_invested | Derived value= monthly_investment * total_months | calculated |
How It Works
Dollar-Cost Averaging (DCA)
DCA involves investing a fixed amount at regular intervals, regardless of market conditions.
How DCA Works
Future Value Formula
FV = PMT x [(1+r)^n - 1] / r
Where PMT is the monthly investment, r is the monthly return, and n is total months.
DCA vs Lump Sum
Historically, lump-sum investing outperforms DCA about 2/3 of the time. However, DCA reduces the emotional risk of investing at a peak and is the natural approach for income earners.
Worked Example
$500/month for 10 years at 8% annual return.
monthly_investment = 500years = 10annual_return = 8
- 01Monthly return = 8% / 12 = 0.667%
- 02Total months = 120
- 03Total invested = $500 x 120 = $60,000
- 04Future value = $500 x [(1.00667)^120 - 1] / 0.00667 = $91,473
- 05Investment gains = $91,473 - $60,000 = $31,473
Ready to run the numbers?
Open Dollar-Cost Averaging Calculator