Dollar-Cost Averaging Calculator

Enter a fixed amount and the price at each purchase. The calculator tracks every purchase and compares the result with a lump sum invested at the first price.

One price per purchase, in order, separated by commas or spaces. The last price values the holding at the end.

Ending Value (DCA)

$2,100.00

Total Invested

$1,500.00

Shares Bought

70

Average Cost per Share

$21.43

Average of the Prices

$23.00

Gain or Loss (DCA)

$600.00

Lump-Sum Shares at First Price

50

Ending Value (Lump Sum)

$1,500.00

DCA minus Lump Sum

$600.00

How it works

Dollar-cost averaging means investing the same dollar amount at regular intervals whatever the price. Each purchase buys the amount divided by that day's price, so you automatically buy more shares when the price is low and fewer when it is high.

Because every purchase is the same dollar amount, your average cost per share is the harmonic mean of the prices, which is never higher than their simple average and is lower whenever the prices differ. That is the arithmetic behind the strategy; it does not mean dollar-cost averaging earns more.

For comparison the calculator also invests the same total as a single lump sum at the first price and values both at the last price you entered. When prices rise steadily the lump sum usually ends ahead because all of its money was invested sooner; when prices fall first and recover, averaging in usually wins. The comparison ignores what the uninvested cash would have earned while waiting.

Formula

shares bought at purchase i = amount ÷ price_i
total invested   = amount × number of purchases
average cost     = total invested ÷ total shares   (harmonic mean of the prices)
ending value     = total shares × last price
lump-sum shares  = total invested ÷ first price
lump-sum value   = lump-sum shares × last price

Example

Investing $300 at prices of $30, $20, $15, $20 and $30 buys 10, 15, 20, 15 and 10 shares: 70 shares for $1,500. The average cost is $1,500 ÷ 70 = $21.43 a share, below the $23.00 average of the prices. At the final $30 price the holding is worth $2,100, a gain of $600.

The same $1,500 invested at the first price of $30 buys 50 shares, worth $1,500 at the end, so in this up-and-down market averaging in finished $600 ahead. With Microsoft's HARMEAN example prices of $4, $5, $8, $7, $11, $4 and $3, the average cost per share is $5.03, the harmonic mean Excel reports (5.028376) rounded to cents.

Assumptions and limitations

  • Prices are the prices you enter; the calculator does not predict them. The last price is used to value both strategies.
  • Fractional shares are allowed and there are no commissions, fees, taxes or dividends.
  • The lump sum is invested at the first price; the cash waiting to be invested under dollar-cost averaging is assumed to earn nothing.
  • Results are estimates for planning and are for informational and educational purposes only. They are not financial, tax or investment advice.

Frequently asked questions

Is dollar-cost averaging better than investing a lump sum?

Not on average when the market tends to rise, because the lump sum is invested for longer. Its value is behavioural and practical: it limits the regret of investing everything just before a fall, and it is how most people invest anyway, from each paycheck.