Calculator

Average cost calculator

Works out the average price paid per share across several purchases (the cost basis), and solves the reverse question: how many shares at a given price would move the average to a target. Fees are not included; add them to the price if you want them counted.

Inputs

Purchases (leave unused rows blank)

Result

Average cost per share$42.5000
Total shares200
Total cost$8,500.00

At $35.00 a share the position is worth $7,000.00: −$1,500.00 (−17.65%) against the cost basis. Break-even price: $42.5000.

Reach a target average

Adding 50.00 shares at $30.00 ($1,500.00) moves the average from $42.5000 to $40.00, on 250.00 shares in total.

Worked example

Purchases: 100 shares at $50, 50 at $40, 50 at $30.

Total cost = 100 × 50 + 50 × 40 + 50 × 30 = $8,500. Total shares = 200. Average cost = 8,500 ÷ 200 = $42.50.

To bring the average down to $40 by purchasing at $30: n = 200 × (42.50 − 40) ÷ (40 − 30) = 50 shares ($1,500.00). Check: (8,500 + 1,500) ÷ 250 = $40.00.

How it is calculated

Average cost = Σ (shares × price) ÷ Σ shares Shares needed = S × (A − T) ÷ (T − X) S = shares held, A = current average, T = target average, X = purchase price

The target can only be reached when it lies strictly between the purchase price and the current average: purchases below the average pull it down toward the purchase price but never past it, and purchases above it pull it up. Otherwise the calculator explains why there is no answer. Brokers may compute cost basis per lot (FIFO, specific identification) for tax purposes; this is the simple weighted average across all lots.

Other calculators

Questions about the data behind these tools: see the help centre and the data methodology.

Data for information only, not investment advice. Figures may be delayed or inaccurate; verify against company filings. See our disclaimer.