Skip to content

Partial sales & investment returns

How to calculate IRR after a partial stock sale

Keep the sale proceeds and the shares still held in one dated-flow calculation. Follow a verified 10% stock IRR versus a 20% ETF mirror after selling half.

A partial sale belongs in IRR as a dated receipt. Keep the original purchase as an outflow, add the sale proceeds on the sale date, and include the value of the remaining shares at the final date. Looking only at the unrealized gain on shares still held loses part of the investment’s history.

Use the full sale proceeds, not just the realized profit. Keep the remaining value separate from money already received. Here is one complete reconciliation, followed by a like-for-like ETF mirror.

Synthetic example · USD · Two years

Sell five shares. Value the five that remain.

Buy ten fictional shares at $100 on 1 January 2022. Sell five at $110 on 1 January 2023, receiving $550. On 1 January 2024, the remaining five shares are worth $121 each, or $605.

Stock IRR
10%Annual dated-flow return
ETF mirror IRR
20%Same dates, 50% sale
The full dated-flow comparison
Date and actionStockETF mirror
Initial purchase−$1,00010 shares × $100−$1,00020 units × $50
Sell half+$5505 shares × $110+$60010 units × $60
Remaining value+$6055 shares × $121+$72010 units × $72

Invented prices and dates, not market history. Each interval is exactly 365 days. USD throughout; no dividends, fees, taxes, FX, additional purchases or corporate actions. Sale proceeds leave the measured investment; idle cash is outside this example. The final row is a valuation, not an actual sale.

01 / Keep every part of the investment

Record cash received, not just profit.

  1. Start with the full original purchase. Record −$1,000 on its date. Do not replace it with the $500 cost assigned to the five remaining shares.
  2. Add the full sale proceeds. Record +$550 on the sale date. The $50 gain on those shares is only one part of that receipt; the other $500 is capital returned.
  3. Value only what remains. Add +$605 at the final date. This represents the five shares still held, not ten shares and not the sold shares’ proceeds again.
  4. State the treatment of income and costs. In a real history, include the relevant dated distributions and charges once. If a sale receipt is already net of a commission, do not subtract that same commission again. The IBKR P&L and dividends reconciliation shows how to count income once.

The terminal value is included so the calculation does not pretend that an unsold holding disappeared. It is not a claim that the position was liquidated or that the quoted value is guaranteed sale proceeds.

02 / Respect when the money arrives

Find the rate that balances the dated flows.

IRR is the annual rate that makes the discounted receipts and final value equal the initial outlay. Because our two intervals are exactly one year, the stock’s equation is:

0 = −1,000 + 550 ÷ (1 + r) + 605 ÷ (1 + r)2

Substitute r = 10%: the first receipt is worth 550 ÷ 1.10 = 500 at the start; the final holding is worth 605 ÷ 1.102 = 500. Together they balance the $1,000 invested.

−1,000 + 500 + 500 = 0

With irregular dates, use actual dates rather than assuming every interval is a year. Microsoft’s XIRR documentation describes a 365-day discounting basis. For a worksheet, put dates in A2:A4 and stock flows in B2:B4, then use =XIRR(B2:B4,A2:A4). Enter real spreadsheet dates and signed numbers, not formatted text. Without a spreadsheet, the free XIRR calculator takes the same three dated flows and shows 10.00%.

The undiscounted receipts and remaining value total $1,155, which is $155 above the original outlay. The ratio 155 ÷ 1,000 = 15.5% ignores when the $550 came back; it is not the 10% annual IRR. Do not compare those two figures as though they use the same convention.

This single-outflow, subsequent-inflows example has one investment IRR. Arbitrary histories can be ambiguous or fail to produce a usable result. The money-weighted return definition explains what a dated-flow return measures; the TWR/MWR guide covers the wider method comparison.

03 / Match the action, then compare returns

A 50% stock sale mirrors a 50% ETF sale.

The fictional ETF starts at $50, so the same $1,000 budget buys 20 units. When the investor sells half the stock holding, the mirror sells ten ETF units. At the hypothetical $60 price, that returns $600. The ten units still held are worth $720 at the final $72 price.

Match the sale proportion, not a forced $550 receipt. Different price paths produce different proceeds. This is the proportional-sale convention used for this comparison, not a promise that an actual ETF trade would execute at these teaching prices.

ETF: −1,000 + 600 ÷ 1.20 + 720 ÷ 1.202 = 0
Annual IRR difference: 10% − 20% = −10 percentage points

Both terms again discount to $500, confirming the 20% ETF IRR. Keep the reporting currency, dates, purchase budget and sale convention aligned. The difference describes this example under those assumptions; it is not a recommendation to sell a holding.

04 / Separate the records from the return

Cost-basis allocation answers another question.

IBKR’s realized and unrealized performance reference explains that closed transactions are matched to opening transactions, with methods such as FIFO and average cost affecting that presentation. A remaining cost basis or a realized-gain line is not a substitute for the full dated receipt list.

Our example has one purchase, so there is no dispute about which lot was sold. With several purchases, preserve every original date and amount for performance analysis. The repeated-purchase worksheet shows how each dated budget enters the calculation. A different lot allocation may redistribute reported realized and unrealized gains; it does not by itself create or remove cash from the transaction record. Tax treatment is a separate question.

The existing open-part and closed-part stock/ETF guide explains cumulative gains allocated to each part. This article’s job is different: reconcile the full sequence of dated outflows, sale receipts and remaining value into an annual IRR.

Sources and assumptions

Sources checked 12 November 2026. Every example price and flow is synthetic. The calculation does not diagnose an individual broker report, establish a broker error or provide tax advice. A price or date missing from a real history must be resolved or disclosed, not invented.