Compute XIRR (annualized return) of stocks and stock portfolio with this sheet!

Published: June 12, 2021 at 11:15 am

Last Updated on July 11, 2021

We are delighted to announce a new spreadsheet that can be used to evaluate the annualised return (XIRR) of individual stocks and that of a stock portfolio after properly taking into account corporate actions like dividends, stock splits, bonuses, buybacks and rights issues.

We had recently published an example using this sheet: Stock XIRR Example: 18% annualized return from Colgate-Palmolive. The sheet can be used to compute the XIRR of any number of individual stocks and the overall XIRR of a 30-stock portfolio.

The XIRR makes a distinction between investor action and corporate actions. All corporate actions are deemed to be reinvested in the portfolio at the ex-date. Only investor actions refect in the XIRR calculations. For example, if you purchased 30 stocks over a period of time, all dividends during this time will be treated as reinvested at ex-date. If this results in additional shares of say, 0.6 stocks, the total number of stocks used in the XIRR calculation would be 30.6.

In addition to XIRR, the sheet also computes absolute capital gain, absolute dividend gain, total gain and the CAGR based on the investment weighted average age of the investment or portfolio.

The CAGR is computed from the total absolute gain. This is the method adopted by as shown in my monthly  stock portfolio updates: My Stock Portfolio May 2021 Update

The average duration of the portfolio is computed as follows.

Suppose you buy Rs. 5000 worth of stocks on 1st Jan 2018 (3.45 years ago) and Rs. 10,000 worth of stocks on 1st June 2019 (2.03 years ago), then the average age duration is: [(5000 x 3.45) + (10000×2.03)]/(1000+5000)

The CAGR = ( 1 + Total Return ) ^ ( 1 / Avg age) – 1

The sheet will compute the CAGR only if the average age is > one year (this can easily be modified by the user). The XIRR will always be computed but it should be taken seriously only the 1st investment was made more than one year ago or if the avg age of the portfolio is > one year.

The sheet is available for download as an Excel sheet. The user must upload the file to Google Drive and open it via Google Sheets. The sheet uses the GOOGLE FINANCE function to retrieve stock price and this will work only on Google sheets. The sheet is completely open-source and can be modified at will. I have extensively tested the file with 391 of my own stock portfolio transactions.

Let us take a look at some screenshots. The file has three sheets with it:  “Stock Portfolio XIRR” for the full portfolio; “Single stock XIRR” for single stocks. You can duplicate this sheet any number of times. “AsianPaints” as an example of single stock XIRR calculation. All sheets will have entires. Please delete them before using the sheet.

This is an overview of the stock portfolio sheet.

Freefincal stock XIRR calculator showing the portfolio XIRR sheet
Freefincal stock XIRR calculator showing the portfolio XIRR sheet

Details of capital gain, XIRR and CAGR of individual stocks. In the overall portfolio calculation, the individual XIRR of some stocks cannot be computed. However, you can create a separate sheet for these stocks to compute XIRR (example in the video below).

Freefincal stock XIRR calculator showing the portfolio XIRR sheet part two
Freefincal stock XIRR calculator showing the portfolio XIRR sheet part two.

Capital gains, CAGR and XIRR of the overall portfolio is shown below.

Freefincal stock XIRR calculator showing the overall portfolio XIRR results
Freefincal stock XIRR calculator showing the overall portfolio XIRR results.

This is the transaction entry sheet. The market price for purchase and redemptions should be entered by the user (else closing price for that date will be fetched from Google Finance). For corporate actions, the ex-date should be entered. The price will be fetched from Google Finance.

Stock transactions entered in the Freefincal stock XIRR calculator
Stock transactions entered in the Freefincal stock XIRR calculator

However, as indicated in the black rectangle above, for corporate actions (in this case dividends) before a split,  we need to provide the market price as Google finance would incorporate the split to past data as well.

This is an example of a single stock XIRR calculation.

Single Stock XIRR Calculation
Single Stock XIRR Calculation

Video walkthrough of the calculator

Get the freefincal stock XIRR calculator

  1. The sheet costs Rs. 1000, but you can avail of a launch discount of 50% and get it for Rs. 500 only.
  2. The sheet will also work for all international stocks. If you are outside India, you can pay via PayPal (9 USD launch discount and 16 USD after that)
  3. you will have to upload the file to Google Drive and open it in Google Sheets.
  4. The sheet has been extensively tested for bugs but we cannot guarantee that it is error-free. In case of bugs please send an email to freefincal AT Gmail DOT com.
  5. No refunds, please!

Click here to pay Rs. 500 and instantly download the freefincal stock XIRR calculator

Outside India? Pay 9USD via Paypal

Do share if you found this useful

Use our Robo-advisory Excel Template for a start-to-finish financial plan! Now with a new demo video!  More than 640 investors and advisors use this!
Our flagship course! Learn to manage your portfolio like a pro to achieve your goals regardless of market conditions! More than 2525 investors and advisors are part of our exclusive Facebook Group! Get clarity on how to plan for your goals and achieve the necessary corpus no matter what the market condition is!! Watch the first lecture for free!  One-time payment! No recurring fees! Life-long access to videos in an exclusive Facebook Group! Reduce fear, uncertainty and doubt while investing! Learn how to plan for your goals before and after retirement with confidence.
Our new course!  Increase your income by getting people to pay for your skills! More than 585 salaried employees, entrepreneurs and financial advisors are part of our exclusive Facebook Group! Learn how to get people to pay for your skills! Whether you are a professional or small business owner who wants more clients via online visibility or a salaried person wanting a side income or passive income, we will show you how to achieve this by showcasing your skills and building a community that trusts you and pays you! (watch 1st lecture for free). One-time payment! No recurring fees! Life-long access to videos in an exclusive Facebook Group!   
My new book for kids: “Chinchu gets a superpower!” is now available!
Both boy and girl version covers of Chinchu gets a superpower
Both boy and girl version covers of Chinchu gets a superpower.
Most investor problems can be traced to a lack of informed decision making. We have all made bad decisions and money mistakes when we started earning and spent years undoing these mistakes. Why should our children go through the same pain? What is this book about? As parents, if we had to groom one ability in our children that is key not only to money management and investing but for any aspect of life, what would it be? My answer: Sound Decision Making. So in this book, we meet Chinchu, who is about to turn 10. What he wants for his birthday and how his parent’s plan for it and teach him several key ideas of decision making and money management is the narrative. What readers say!
Feedback from a young reader after reading Chinchu gets a Superpower (small version)
Feedback from a young reader after reading Chinchu gets a Superpower!
Must-read book even for adults! This is something that every parent should teach their kids right from their young age. The importance of money management and decision making based on their wants and needs. Very nicely written in simple terms. - Arun.
Buy the book: Chinchu gets a superpower for your child!
How to profit from content writing: Our new ebook for those interested in getting side income via content writing. It is available at a 50% discount for Rs. 500 only!
Did you know? We have more than 1000+ videos on YouTube to explore! Join our YouTube Community!

Want to check if the market is overvalued or undervalued? Use our market valuation tool (will work with any index!), or you buy the new Tactical Buy/Sell timing tool!
We publish mutual fund screeners and momentum, low volatility stock screeners .every month.
About the Author Pattabiraman editor freefincalM. Pattabiraman(PhD) is the founder, managing editor and primary author of freefincal. He is an associate professor at the Indian Institute of Technology, Madras. since Aug 2006. Connect with him via Twitter or Linkedin Pattabiraman has co-authored three print books, You can be rich too with goal-based investing (CNBC TV18), Gamechanger, Chinchu Gets a Superpower! and seven other free e-books on various money management topics. He is a patron and co-founder of “Fee-only India,” an organisation to promote unbiased, commission-free investment advice. He conducts free money management sessions for corporates and associations based on money management. Previous engagements include World Bank, RBI, BHEL, Asian Paints, Cognizant, Madras Atomic Power Station, Honeywell, Tamil Nadu Investors Association, IIST Alumni Association. For speaking engagements, write to pattu [at] freefincal [dot] com
About freefincal & its content policy Freefincal is a News Media Organization dedicated to providing original analysis, reports, reviews and insights on developments in mutual funds, stocks, investing, retirement and personal finance. We do so without conflict of interest and bias. Follow us on Google News. Freefincal serves more than three million readers a year (5 million page views) with articles based only on factual information and detailed analysis by its authors. All statements made will be verified from credible and knowledgeable sources before publication. Freefincal does not publish any paid articles, promotions, PR, satire or opinions without data. All opinions presented will only be inferences backed by verifiable, reproducible evidence/data. Contact information: letters {at} freefincal {dot} com (sponsored posts or paid collaborations will not be entertained)
Connect with us on social media
Our publications

You Can Be Rich Too with Goal-Based Investing

You can be rich too with goal based investingPublished by CNBC TV18, this book is meant to help you ask the right questions, seek the correct answers, and since it comes with nine online calculators, you can also create custom solutions for your lifestyle! Get it now. It is also available in Kindle format.
Gamechanger: Forget Startups, Join Corporate & Still Live the Rich Life You Want Gamechanger: Forget Start-ups, Join Corporate and Still Live the Rich Life you wantThis book is meant for young earners to get their basics right from day one! It will also help you travel to exotic places at a low cost! Get it or gift it to a young earner.

Your Ultimate Guide to Travel

Travel-Training-Kit-Cover-new This is an in-depth dive analysis into vacation planning, finding cheap flights, budget accommodation, what to do when travelling, how travelling slowly is better financially and psychologically with links to the web pages and hand-holding at every step. Get the pdf for Rs 199 (instant download)
Free android apps