What does XIRR mean?
XIRR stands for extended internal rate of return. An internal rate of return is the yearly rate at which the money you put in grows into the money you get back. The plain IRR assumes the cash flows come at regular intervals, a year or a month apart. The extended version takes the actual date of each one, which is what a stock portfolio needs, because a stock investor's buys rarely fall on a schedule.
Say you buy ₹1 lakh of shares on 1 April 2024, another ₹1 lakh on 1 April 2025, and the whole lot is worth ₹2.3 lakh on 31 March 2026. You made ₹30,000 on ₹2 lakh, or 15%, over two years. Your XIRR is 9.7% a year. At 9.7% a year, the first lakh earns about ₹20,300 over its two years and the second about ₹9,700 over its one, which together make your ₹30,000.
The XIRR function in Excel and Google Sheets does the same sum, and so does the free calculator.
What your XIRR says about you, and what it doesn't
XIRR is the number for what happened to your money. It counts what you paid, what you got back, every dividend and what you hold today, each for exactly the days it was invested. If you want to know whether the portfolio beat your FD, XIRR is the number to use.
What it can't do is say why. A portfolio's return is two things at once: how the stocks you held performed, and when and how much money you had in them. XIRR blends the two into one figure. A high XIRR can be ordinary stocks bought shortly before a market-wide rally. A low one can be good stocks with most of the money added shortly before a fall.
Mine is a mild case. Over 4.9 years of tradebooks, 18 November 2021 to 15 October 2026, my XIRR was 10.32% a year. Set beside the Nifty 50 TRI's 6.64% for the same dates, it looks like a 3.68-point lead. The time-weighted return, which takes my timing out, was 11.16%. So my stocks beat the index by 4.52 points a year, and my timing gave back 0.84 of that. The XIRR alone said I was doing well. Only the TWRR beside it showed what my timing had cost.
To separate the two you need the time-weighted return (TWRR) beside your XIRR. XIRR vs CAGR walks through why they split and how to read the gap year by year.
What your broker's XIRR may leave out
Before you read anything into the XIRR on your broker's screen, check what it covers. Zerodha's support page says the portfolio XIRR in Console's Analytics "combines your current holdings and displays the annualised returns", and that it leaves out your past buy and sell trades. Every stock you have sold, at a profit or a loss, is outside that number.
That makes it a return on the stocks that survived. If you sold your losers and kept your winners, the figure flatters you. If you sold winners early and held on to the losers, it shows a worse return than you made, because the gains you booked sit outside it. The same page says Console shows a dash instead of the figure when most of your holdings are less than a year old.
A single stock's XIRR is a different case. Zerodha says a holding's XIRR counts all your trades in that stock since FY2017, adjusted for bonuses, splits and other corporate actions. Other brokers label these numbers differently, so read what yours covers before you compare it with anything.
How to calculate XIRR for a stock portfolio
You need every cash flow, with its date and the right sign.
- Every purchase in your tradebook, as a negative amount on the trade date (shares × price).
- Every sale, as a positive amount on the trade date.
- Every dividend, as a positive amount on the date it was paid. (The calculator dates dividends on the ex-date, before TDS, so expect a small difference.)
- What you hold today, at today's closing prices, as one positive amount dated today, as if you sold it all.
Put the amounts in one column and the dates in the next, then type =XIRR(amounts, dates) in Excel or Google Sheets. The function finds the rate at which all the flows net to zero over a 365-day year.
| Date | Cash flow | What it is |
|---|---|---|
| 10 Jun 2024 | −₹50,000 | First purchase |
| 5 Dec 2024 | −₹1,00,000 | Second purchase |
| 20 Aug 2025 | +₹40,000 | Part of the position sold |
| 25 Aug 2025 | +₹1,200 | Dividend |
| 15 Oct 2026 | +₹1,45,000 | Value of what you still hold |
The XIRR comes out at 13.1% a year. You put in ₹1.5 lakh and have ₹1,86,200 back or in hand: an absolute gain of 24.1% over 28 months.
Two things trip people up. If you work out today's holding from the tradebook, add the shares any split or bonus gave you, because the tradebook doesn't show them and leaving them out understates what you hold. And the trade prices in a tradebook leave out brokerage, STT and stamp duty, so a tradebook XIRR reads slightly better than the money you made.
Or upload the tradebooks to the XIRR vs TWRR calculator. It reads files from Zerodha, Groww, Upstox, Angel One, ICICI Direct and other brokers, adds dividends, splits and bonuses from NSE's records, uses each day's close to value what you hold and to build the TWRR, and shows the TWRR beside your XIRR.
Why your XIRR can look wrong
A huge XIRR on a recent buy
XIRR is a yearly rate, so a short stretch gets compounded up to a year. A 5% gain in a month comes out at about 80% a year. The figure is arithmetically right and tells you almost nothing. Zerodha hides the portfolio figure for this reason, and the calculator shows the plain return for anything under a year, as the global performance-reporting standard (GIPS) requires.
An XIRR far from your absolute return
Absolute return is your total gain divided by everything you put in, whenever it went in. XIRR also counts how many days each rupee was invested. In the example above the absolute return is 24.1% and the XIRR 13.1% a year, and both are right. Absolute return works for a single purchase. It can't compare a two-year holding with a five-year one.
A negative XIRR while the broker shows a profit
The profit on a holdings screen is usually the unrealised gain on what you own today. A full XIRR also counts the stocks you have sold. A portfolio of current winners with a history of sold losers can show green on the holdings screen and a negative XIRR, which is why it matters which of the two your broker's own XIRR covers.
When XIRR on its own is enough
If the question is about your money, such as whether it beat a fixed deposit, XIRR alone is the right number and splitting it adds nothing.
If you bought once and never added or sold, there is no timing to separate, and XIRR equals the time-weighted return, or comes close to it once dividends are counted.
The split matters when you judge yourself as a stock picker, or decide whether to change how you add and sell. For anyone running a portfolio of their own stocks, that is most of the reason to look at a return at all.