# Which numbers do I include in XIRR?

I would just like some clarification on measuring returns on my portfolio. I have invested in approximately 25 shares over a period of two years. The investments I make are irregular and so I believe I have correctly used the XIRR formula in a Google sheet with two columns: one for the date of each purchase and another for the cash value I put into my stocks and shares ISA, NOT the book cost of the investment.

However should I use the total cost of each share purchase to account for the costs incurred when purchasing the share (including stamp duty and broker fees)? For instance, if I transfer £1500 as cash into my stocks and shares ISA but the total cost of the investment is £1490 because of stamp duty and broker fees. Which number should I use: £1500 or £1490.

Lastly, am I correct in not including rows for dividends that I receive from each stock because that is not money I have invested from my own pocket, rather it is a part of my return which is being measured by XIRR?

Thanks for any help in advance; I just want to make sure I am measuring my portfolio returns accurately as possible as early as possible.

XIRR is simply a calculation of the value of irregular cash inflows and outflows. It does not know what those flows represent, just what the amounts and timings are.

From that perspective, all cash into or out of your pocket should be included. If you bought a house for 100k, but paid 15k in closing costs, and you sold it a year later for 105k, would you say that you had a 5k gain, or a 10k loss? Truly your loss would be your all-in net proceeds less your all-in net costs, so this should show as a 10k loss in your personal accounting.

Likewise all transaction costs and offsetting dividend income should be included when calculating the return from your portfolio.

If you're trying to measure your net-of-costs return, you would include all money in and out of your account. This includes dividends, fees, and commissions.

If you needed a gross-of-fees return (to compare against funds that show returns this way), you could exclude fees and commissions. Dividends should always be included, however. They are part of the return from the investment, no matter how you want to measure it.