Dollar-Cost Averaging Calculator
Average cost, shares, final value, and profit for equal contributions across a series of prices.
What it does
Dollar-cost averaging means investing the same dollar amount on a schedule, regardless of the price. When the price is low, the fixed contribution buys more shares. When the price is high, it buys fewer. The result is an average cost that sits between the prices in the series.
This calculator takes a contribution amount and a list of prices in the order you bought. It assumes the same amount is invested at every price and that fractional shares are allowed. It then reports the shares owned, the average cost, the final position value at the last price, and the profit or loss.
The default example invests $500 six times at prices of 10, 12, 8, 10, 14, and 16. The contributions total $3,000, the shares total 271.131, and the average cost is $11.06. At the final price of 16, the position is worth $4,338.10, a gain of $1,338.10 or 44.6 %.
The average cost is not the average of the six prices, which is $11.67. The lower prices received more shares because the dollar amount was fixed. That difference is the mechanical benefit of buying a fixed amount rather than a fixed share count.
DCA is a scheduling rule, not a magic edge. It removes the need to time each purchase and can reduce the regret of investing a lump sum right before a fall. In a market that rises steadily, however, a lump sum invested earlier often finishes ahead. Fees, taxes, dividends, and the investment itself matter more than the schedule.
How to use
- Enter the dollar amount you invest at each purchase.
- Enter the share prices in the same order as your purchases.
- Keep the number of prices equal to the number of contributions you made.
- Read the average cost and total shares first.
- Check the final value, profit, and return at the last price.
- Rerun with fees or a different final price to test how sensitive the result is.
Formula
- C
- Contribution amount in dollars per buy.
- P_i
- Share price at purchase i.
- N
- Number of purchases.
- S
- Total shares accumulated.
The final value uses the last price in the list as the mark-to-market price. The calculation ignores commissions, bid-ask spreads, taxes, dividends, and cash drag between purchases. Fractional shares are assumed. If your broker charges a fee per trade, subtract it from the contribution or add it to the cost basis before comparing strategies.
Worked example
Example: $500 invested at six prices
The default contribution and price series are already filled in the form.
- Total invested: 6 x $500 = $3,000.00.
- Shares at each price: 500/10 = 50, 500/12 = 41.6667, 500/8 = 62.5, 500/10 = 50, 500/14 = 35.7143, and 500/16 = 31.25.
- Total shares: 50 + 41.6667 + 62.5 + 50 + 35.7143 + 31.25 = 271.131.
- Average cost: $3,000 / 271.131 = $11.0648, shown as $11.06.
- Final value at the last price: 271.131 x $16 = $4,338.10.
- Profit: $4,338.10 - $3,000.00 = $1,338.10, a return of 44.6 %.
Reference table
| Price path | Average cost | Final value | Return |
|---|---|---|---|
| 10, 12, 8, 10, 14, 16 | $11.06 | $4,338.10 | +44.6 % |
| 10, 10, 10 | $10.00 | $1,500.00 | +0.0 % |
| 5, 10 | $6.67 | $1,500.00 | +50.0 % |
| 20, 10, 10 | $12.00 | $1,250.00 | -16.7 % |
Limits
- The result depends on the final price chosen as the ending mark, not on a forecast.
- Fees, taxes, dividends, and cash held between purchases are ignored.
- Fractional shares are assumed; whole-share rules leave small cash leftovers.
- A lower average cost does not guarantee a profit if the final price is below it.
Common mistakes
- Averaging the prices instead of weighting each price by the shares bought at that price.
- Using different contribution amounts but entering a single fixed amount.
- Ignoring trading fees, which hurt small frequent contributions more.
- Treating DCA as protection against a bad investment rather than a timing rule.
- Comparing a DCA result with a lump sum without aligning the investment period and final price.
Try it yourself
Quick checks. Answers sit tucked under each question.
$200 is invested at prices 10 and 20. What are the average cost and return at 20?
Shares are 20 + 10 = 30 and $400 is invested. Average cost is $13.33. Final value is 30 x $20 = $600, a gain of $200 or 50.0 %.
$100 is invested at prices 10, 5, and 10. What is the average cost?
Shares are 10 + 20 + 10 = 40 and $300 is invested. Average cost is $7.50. At the last price of $10 the value is $400, a gain of 33.3 %.
$500 is invested at prices 20, 10, and 5. What is the loss at the last price?
Shares are 25 + 50 + 100 = 175 and $1,500 is invested. Average cost is $8.57. Final value is 175 x $5 = $875, a loss of $625 or 41.7 %.
Questions
What is dollar-cost averaging?
Investing a fixed dollar amount on a schedule, so you buy more shares when prices are low and fewer when prices are high.
Is DCA better than a lump sum?
Not always. DCA reduces timing risk and regret, while a lump sum can win when markets rise. The better choice depends on cash available, risk tolerance, and the investment.
Why is the average cost not the average price?
Each price is weighted by the number of shares bought at that price. Lower prices buy more shares, so they carry more weight.
Does this calculator include dividends?
No. It tracks price only. Reinvested dividends would add shares and change the final value.
Can I use weekly or monthly contributions?
Yes. Enter one price per contribution in date order. The schedule itself does not change the formula.
What happens if the price falls to zero?
The tool rejects zero prices because it divides by the price. A total loss is outside the model.