In sheet "Dividends" I have a table with dividends sorted by daily dates. E.g, columns A and B contain the following entries:
This means that the stock paid a dividend of 0.045 on 6/12/2015.
In another sheet "AdjClose", I have a table with weekly dates and stock prices, e.g.
I would now compute the yield, where I divide the dividend by the stock price that is closest to the date of the dividend payout, but smaller than that date.
The result should be:
How could I do this? Many thanks for any input.
Best How To :
Following 4 named ranges for simplicity in code: "Dividends": DividendDates (column A); DividendsPaid (column B) "AdjClose": StockDate (column A); StockPrice (column B)
try (in column C in "Dividends":
Assuming that the dividend date for which you want to find the adjusted stock price is in cell A1.
And copy down for each dividend date. This will give you the stock price of the day closest to, but before, you dividend date (or on the date if it is the same). Then just devide by your dividend for that day (either in the formula I wrote, or in a separate column. Always good to show your calculations steps, so it is easier to follow.
And remember to press CTRL + SHIFT + ENTER when you enter the formula, not just ENTER, as it is an array formula.
EDIT: Also, you need to change the ; to , if that is the formula separator of your language.