Logo

CoreBalance

Portfolio Dashboard

Interactive Tool

Average Purchase Price Calculator

Add your buys, sells and dividends and see live your weighted average cost, total cost basis and unrealized P&L — the same ledger accounting CoreBalance uses.

1. Your Transactions

Rows are processed top to bottom (chronological order).

For a dividend row: shares × price = gross amount received; use the fees field for withholding tax.

Average Purchase Price

87.9333 €

Weighted average cost per share, fees included and net dividends deducted.

2. Your Position

Total shares 15
Total cost basis 1,319.00 €

3. Unrealized P&L (optional)

Enter a current price to see your unrealized P&L.

What is the average purchase price and why does it matter?

Your average purchase price is the weighted average of everything you paid for a position — total cost invested (fees included) divided by the shares you hold. It is the reference that tells you whether a position sits at a gain or a loss, and it only moves when new money enters or leaves the cost basis.

Because it is weighted, a large buy moves it a lot and a small buy barely moves it. That is why averaging down with small contributions lowers your average price much more slowly than most investors expect.

Why does selling NOT change your average price?

Because when you sell, you remove shares at exactly their average cost: the total cost basis shrinks in the same proportion as the shares, so the ratio between the two — the average price — stays identical for what remains.

It is a very common mistake to think that selling your "expensive" shares lowers the average price of the rest. What a sale changes is your realized gain or loss; the cost of the shares still in the portfolio is untouched. This calculator applies exactly that rule: a sell reduces the total cost proportionally and leaves the average price of the remainder as it was.

Why CoreBalance deducts dividends from the cost basis

CoreBalance follows a conservative accounting approach: each net dividend received is subtracted from the total cost of the position, so your average price gradually drops. The idea is that a dividend is capital you have already recovered — your money at risk is smaller.

Other tools count dividends as separate profit instead: the average price never changes and dividends are added on top of the return. Both approaches are valid and end up measuring the same total performance; they simply show it in a different place. Just make sure you do not mix the two, or you will double-count your dividends.

FIFO or average cost: which method does the Spanish tax agency apply?

For sales of stocks and ETFs in Spain, Hacienda applies FIFO (first in, first out): the shares you bought first are considered the first ones sold, regardless of your average price. The taxable gain of a sale is therefore computed against the cost of your oldest shares, not against the weighted average shown here.

This calculator uses the weighted average cost method because it is the most useful metric for tracking a portfolio day to day. It is informational only — not tax advice and not a substitute for the FIFO computation your tax return requires. For your filing, rely on your broker's tax report or a professional advisor.

Put your transaction ledger on autopilot

In CoreBalance the transaction ledger does all of this automatically — average price, cost basis and P&L updated with every buy, sell or dividend — and you can import your broker's CSV in seconds. Free, local and 100% private.