12mcarchedi
New Member
- Joined
- Jan 19, 2015
- Messages
- 8
Hey guys,
I've been looking around for this for a while now, and I can't really seem to find exactly what I am looking for. I am trying to return stock prices from 4-weeks ago from the current date, the ending of last quarter, and the ending of last year. The problem is when any of those dates are a holiday or on a weekend, it doesn't pull the prices since stocks don't trade during these days. Is there a way to pull the last business day, so excluding holidays and weekends, for these different periods using normal excel functions? If not, is it possible to do it with VBA and if so could someone help me write that code?
Just for an example, if I am trying to find the price difference between the current price and the year ending price between 2011/2012, I wouldn't be able to pull the year end price since 12/31/2011 ends up on a Saturday. In this case, I would need to pull the price from 12/30/2011 instead, as it is the last price during that period.
Thanks for any help in advance, and I will gladly provide anymore clarification if needed.
Best,
MJC
I've been looking around for this for a while now, and I can't really seem to find exactly what I am looking for. I am trying to return stock prices from 4-weeks ago from the current date, the ending of last quarter, and the ending of last year. The problem is when any of those dates are a holiday or on a weekend, it doesn't pull the prices since stocks don't trade during these days. Is there a way to pull the last business day, so excluding holidays and weekends, for these different periods using normal excel functions? If not, is it possible to do it with VBA and if so could someone help me write that code?
Just for an example, if I am trying to find the price difference between the current price and the year ending price between 2011/2012, I wouldn't be able to pull the year end price since 12/31/2011 ends up on a Saturday. In this case, I would need to pull the price from 12/30/2011 instead, as it is the last price during that period.
Thanks for any help in advance, and I will gladly provide anymore clarification if needed.
Best,
MJC