I want to calculate IRR (internal rate of return) for stock purchases. Not sure if I am doing it right, hope some of you might confirm it.
Lets say I bought stock JNJ in 2005, 20 shares for $50 each. JNJ pays dividends quarterly. I am trying to differentiate two cases:
- I get dividends in cash
- I reinvest dividends and buy some extra JNJ (DRIP)
I am using XIRR calculation - dividends might be paid irregularly or I might get cash and reinvest dividends on random occasion. So I pass these data to calculate it:
- (date of purchase, -20x$50)
- (date of dividend, dividend amount * stock price) #if I take cash
- (date of dividend, dividend amount * stock price) #if I take cash
- ...
- (today, today's value * shares)
In case I reinvest dividends, I will include it in next rows in number of shares and also any future cash withdrawal will be higher (since I own more shares = more dividends).
Question #1: Is this calculation ok?
Question #2: If I buy 20 shares every year, how do I get proper IRR? I can not just include it to existing calculation, because XIRR calculates difference between date of purchase and dividend date (I would have multiple purchase dates). Or may I? Would I calculate average with respect to today's value of single purchase?
Edit1:
Thanks for answer @Chris, but I don't think you understood my question, so I am posting examples:
Question #1: I bought 20 shares of JNJ on 2014-01-01 for $89. Here is table of dividends and stock price on the dividend date:
If I cash out all dividends, will my XIRR function get these data:
Column C shows what is actually calculated in column B. Number of shares times dividend amount. This is how I calculate XIRR if I get dividends paid out in cash, correct (XIRR = 13%)?
If I do not cash out, but reinvest these dividends, XIRR table looks like this:
Since I did reinvest my dividends, I do not have 20 shares on 2015-03-08
, but 20.707 - adds up to 2070.7 portfolio value and XIRR is 13.7%. Correct?
Question #2:
I bought 20 shares of JNJ on 2014-01-01 for $89 and 10 shares of JNJ on 2014-06-01 for $89 as well. This is my table:
Is this correct? In my point of view, XIRR calculates difference between initial date of purchase and date of each transaction(=dividend date). So for every next stock purchase, it will not calculate it's date to t(t in your formula), but date from first purchase as t.
I can not describe it properly. Basicly, can I just add all next purchases like I did in Question #2 or do I need to calculate XIRR for seperate stock purchases and then combine them somehow.