How Many Shares to Reach a Target Average Cost
The question many people actually have is the reverse of the usual one: “How many shares would I need to buy at today's price to bring my average down to $100?” The average cost formula can be solved for the number of shares, which gives a direct answer and also shows when there is no answer at all.
The formula
Let A be your current average, Q the shares you own, P the current price, T your target average and x the shares to buy. The average after buying is (A×Q + P×x) ÷ (Q + x) = T. Multiply both sides by (Q + x) and rearrange to get x(T − P) = Q(A − T), so:
Shares needed = shares owned × (current average − target) ÷ (target − current price)Since most brokers sell whole shares, a fractional result is rounded up. Rounding down would leave the average slightly above the target. The calculator shows the smallest whole number of shares that puts your average at or below the target.
Example: 40 shares at $120, price now $90
| Target average | Formula result | Shares to buy | Cost | Resulting average |
|---|---|---|---|---|
| $115 | 8 | 8 | $720 | $115.00 |
| $112 | 14.55 | 15 | $1,350 | $111.82 |
| $110 | 20 | 20 | $1,800 | $110.00 |
| $105 | 40 | 40 | $3,600 | $105.00 |
| $100 | 80 | 80 | $7,200 | $100.00 |
| $95 | 200 | 200 | $18,000 | $95.00 |
Checking the $100 row by hand: 40 × ($120 − $100) ÷ ($100 − $90) = 800 ÷ 10 = 80 shares. Then ($4,800 + $7,200) ÷ 120 = $100.
Notice how fast the cost grows as the target approaches the price. Moving the target from $105 to $95 multiplies the money required by five, from $3,600 to $18,000. The reason is the denominator, target minus price, which heads toward zero.
Why a target at or below the price is impossible
Your new average is a weighted average of your old average and the price you buy at, so it always sits between the two. With the stock at $90, buying more pulls your average toward $90 but never to $90 or below. A target of $90 or less therefore has no solution.
The formula agrees: when target minus price is zero you would divide by zero, and when it is negative the answer is a negative number of shares. For instance, if the stock were at $118 and your target were $115, every share bought at $118 pulls your average toward $118, away from $115. The calculator shows a message instead of a share count in that case.
The other direction
If the price is above your average, buying more raises your average (sometimes called averaging up). The same formula works, as long as the target is above your current average and below the current price.
Things to compare the result against
- Whether the cost in the table fits the cash you have actually set aside for this position
- What share of your total portfolio the position would become after the purchase
- That the break-even sell price, after any commissions, sits slightly above the average