Productive Ant

Manage your money.

XIRR vs TWR: how to measure your real investment return

What XIRR and TWR each measure, realized versus unrealized gains, why cost basis matters and how yield on cost works. From the Money Kit guide.

6 min read

Your brokerage app says you are up 14%. A spreadsheet you built says 6%. A friend who bought the same fund says 11%. All three can be right, because “return” is not one number. It depends on what you count, from when, and whether your own timing is part of the answer.

This guide walks through the numbers that matter: unrealized and realized gains, cost basis, the two kinds of return called XIRR and TWR, and the income a portfolio pays you. Each comes with a worked example in dollars.

Unrealized and realized gains: paper and booked

An unrealized gain is on paper. It is what you would make if you sold today: the value now minus what you paid. It changes every time the price moves, and in most countries nothing is owed on it.

A realized gain is booked. It happens the moment you sell, and from then on it is fixed. In most countries this is the number tax is worked out on.

Say you buy ten shares at $100. They rise to $150, so you have $500 unrealized. You sell four at $150. You now have $200 realized, and the six you kept still carry $300 unrealized. Keeping the two apart matters: a large unrealized number is not money yet, and a realized one may come with a tax bill.

How cost basis changes your realized gain

When you sell part of a position you bought at different prices, which units left? The answer is your cost basis method, and it sets the realized gain.

  • FIFO (first in, first out) says the oldest units left first.
  • Average cost pools every unit into one price.

Example: you buy ten units at $100, then ten more at $200. Later you sell ten at $250.

Method Cost of the units sold Realized gain
FIFO $1,000 $1,500
Average cost ($150) $1,500 $1,000

Same sale, two different numbers. Over the life of the position the total is identical; the method only moves gain from one year to another. In the US, FIFO is the usual default for shares unless you name specific lots, and average cost is allowed for mutual fund shares. Whatever you choose, match what your broker reports.

What is XIRR?

XIRR answers “how did I do?” It takes every buy, sale and dividend on its own date, adds today’s value, and finds the one yearly rate that explains all of it. Spreadsheet users know it as the XIRR function.

Because it knows when you put money in, your timing moves it. Money added just before a strong run lifts XIRR. Money added just before a fall drags it down. That makes it the honest answer to “what did my money earn?”, and the wrong number to compare with an index fund’s published return.

What is TWR?

TWR, time-weighted return, answers “how did the holdings do?” It cuts your history into periods at each valuation, measures each period on its own, and chains them together. A large deposit right before a good month does not flatter it, and one right before a bad month does not punish it.

That is why fund factsheets and index providers publish time-weighted numbers. If you want to know whether your picks beat a simple index, TWR is the one to compare.

XIRR vs TWR: one example, two answers

Here are two investors who own a fund for one year and make the same two deposits.

Investor A puts in $10,000 on January 1. By July 1 the fund is down 10%, so A has $9,000 and adds $20,000. In the second half of the year the fund rises 10%.

Investor A Investor B
First half −10% +10%
Second half +10% −10%
Value on December 31 $31,900 $27,900
TWR −1.0% −1.0%
XIRR +9.6% −10.4%

Investor B is the same story with the halves reversed: up 10% to $11,000, add $20,000, then down 10%.

In both stories the fund returned −1% over the year; only the order of the halves differs. TWR says so. XIRR tells each investor what happened to their own money, and the timing of that one big deposit swings it by twenty points.

Reading the gap

  • XIRR well below TWR: most of your money arrived before the weaker stretches.
  • XIRR above TWR: your deposits happened to land before strong stretches.
  • The two close together: your timing neither helped nor hurt.

None of this means you should try to time deposits. A gap in one year is mostly luck. Over many years, steady contributions tend to keep the two close, which is one argument for buying on a fixed schedule.

Income: dividends, sales and yield on cost

Money comes back from a portfolio in two ways. A dividend is cash a company or fund pays you for holding it; you keep the shares. A sale turns shares into cash, and the income is the gain over what they cost you. Dividends tend to be steady and repeat. Sale gains are lumpy and happen only when you decide.

Yield on cost measures a dividend against what you paid, not against today’s price. You buy a share at $50 that pays $2 a year: 4% on cost. Years later the price is $100 and the dividend has grown to $3. The plain yield is 3%, but your yield on cost is 6%. It is a good way to see what an old holding pays you, and a poor way to compare it with a new purchase, which can only earn today’s yield.

Common mistakes

  • Comparing XIRR with an index. Use TWR for that.
  • Leaving fees out. A gain before fees overstates what you made. Fees belong in the cost basis.
  • Ignoring currency. A foreign holding can be up in its own currency and down in yours. See one portfolio, several currencies.
  • Counting unrealized gains as income. They are not money until you sell.
  • Changing cost method to make a year look better. The total does not change, and your records stop matching your broker’s forms.

How Money Kit measures your returns

In Money Kit, the Investments performance page shows XIRR as “your return” and TWR as “the holdings’ return” side by side, reads the gap in one sentence and lists XIRR for each holding. TWR is built from monthly snapshots of the portfolio’s value, which you take with one button. Unrealized and realized gains are kept apart, and the first time you record a sale the kit asks whether to use average cost or FIFO; changing it later in Settings recalculates every figure without touching your transaction log. The income page keeps dividends and sale gains apart month by month and lists yield on cost for each holding. You type in your trades and paste in prices; the file never connects to a bank or fetches anything.

This article is general education, not personal financial advice.

Questions

What is the difference between XIRR and TWR?

XIRR is your own return: it counts every deposit and withdrawal on its date, so your timing moves it. TWR is the return of the holdings themselves: it removes the effect of when you added money, which makes it the number to compare with an index.

Why is my XIRR lower than my TWR?

Most of your money went in before the weaker stretches. The holdings did fine on average, but more of your money was exposed during the bad months than during the good ones.

Should I use FIFO or average cost?

Your total gain over the life of a position is the same either way; only the year it shows up changes. Use the method your tax office or broker uses, so your records match the forms you will file.

Start with the free one.

Meeting Cost is a full tool, not a trial. If you like how the file behaves, the kits work the same way.

A real screen from the kit, with sample data