Dollar-Cost Averaging and Average Cost Basis: The Math, With Worked Examples
If you've bought the same stock more than once — at different prices — you own it at a blended "average cost." Knowing that number tells you whether you're actually up or down, and it's the foundation of dollar-cost averaging (DCA), the simplest discipline for building a position without trying to time the market. Here's the exact formula, a worked example, and what DCA does and doesn't do.
01 Average cost basis: the weighted-average formula
Your average cost is not the simple average of the prices you paid. It's weighted by how many shares you bought at each price:
Average cost = Total money spent ÷ Total shares owned
= Σ (price × shares) ÷ Σ (shares)
The weighting matters: buying 100 shares at $50 and 10 shares at $40 does not average to $45. The $50 buy dominates because it's 10× larger.
02 Worked example
- Buy 1: 100 shares @ $50 = $5,000
- Buy 2: 100 shares @ $45 = $4,500
- Buy 3: 50 shares @ $55 = $2,750
Total spent = $12,250. Total shares = 250. Average cost = $12,250 ÷ 250 = $49.00 per share.
If the stock now trades at $60: market value = 250 × $60 = $15,000, so your unrealized gain is $15,000 − $12,250 = +$2,750 (+22.4%). The simple average of the three prices ($50) would have given you the wrong answer.
This is exactly why "averaging down" can feel good but needs care: buying more at a lower price pulls your average cost down, but it also increases your exposure to a falling stock. A lower average cost is not the same as a safer position.
03 What dollar-cost averaging actually is
DCA means investing a fixed amount at regular intervals — say $500 on the 1st of every month — regardless of price. Because the amount is fixed, you automatically buy more shares when prices are low and fewer when prices are high. Over time this tends to produce an average cost below the average price over the period.
What DCA is really buying you is behavioral, not mathematical:
- It removes timing decisions. You don't have to guess bottoms or tops — the schedule decides for you.
- It builds the habit. Automatic, recurring investing is the single most reliable way most people actually accumulate wealth.
- It smooths entry risk. You won't lump-sum the entire amount right before a crash (though you also won't lump-sum right before a rally).
DCA does not guarantee a profit or protect against loss in a falling market. And historically, lump-sum investing has beaten DCA roughly two-thirds of the time, because markets rise more often than they fall — money invested sooner compounds longer. DCA's real edge is that it's a plan you'll actually stick to, and it limits the regret of a badly-timed lump sum. It's a discipline tool, not a market-beating formula.
04 Projecting a DCA plan
To estimate where a recurring plan lands, you compound each contribution forward. With a monthly contribution M, an expected annual return r (converted to a monthly rate), and n months:
FV = M × [((1 + i)ⁿ − 1) ÷ i], where i = monthly rate = (1 + r)^(1/12) − 1.
Example: $500/month at 8%/year for 20 years ≈ $284,500, of which $120,000 is money you put in and ~$164,500 is growth. The growth back-loads: most of it arrives in the final years, which is why time in the market matters more than the exact entry price.
That 8% is an assumption, not a promise — real returns vary wildly year to year, and a sequence of bad early years can materially change the outcome. Treat the projection as a planning scenario.
05 Run your own numbers (free)
Two modes: Average my buys (enter each price × shares, get your true average cost and live P/L) and Project recurring DCA (monthly amount, expected return, years → future value and a year-by-year table). Works offline, your data never leaves your device.
Open the free DCA Calculator →Averaging in builds the position; these companion tools plan what it pays you. The Dividend Income Planner projects passive dividend income with DRIP, and the Wheel Options Calculator plans covered-call premium income. One-time purchase, offline.
See the full toolkit →The brokers that make DCA effortless support automatic recurring buys and fractional shares — so $500/month invests itself without you logging in. Set it once, let the schedule do the discipline.
Find a broker with automatic investing →Once your cost basis is set, plan premium income with the Wheel Calculator or dividend cash flow with the Dividend Planner. Both are offline, one-time purchases.
Wheel Calculator — $19 → Dividend Planner — $12 →- Average cost = total spent ÷ total shares — weighted by size, not a simple average of prices.
- DCA = fixed amount, regular schedule. It buys more shares low, fewer high, and removes timing decisions.
- DCA's edge is behavioral, not mathematical — lump-sum wins more often historically, but DCA is the plan people stick to.
- Compounding back-loads: most growth arrives late, so time in the market beats perfect entry timing. Returns are never guaranteed.