Workday an Stockh functions working together
Hi,
I'm setting up a table to track a stock portfolio and would like to measure the month to date performance. To do that, I first need to have both today's stock price (using the stock function) and the price that the stock was at the end of the previous month (using the stockh function). The stock function is straightforward as it always uses yesterday's date and it shows the stock's current price. However, for the stockh function you need to provide the date for the price that you need. If I want the formula give me the stock price for a specific I can input it manually but since I have a portfolio of stocks and would like this to be calculated every month, I would like this to be calculated automatically, so I though I could do the following:
For the holidays to be excluded, I have the following table:
The problem I'm having is that I need the workday formula to give me the stock price for the exact last trading session of the month (in this case, 28/05/21), so I have to use a 0 for work-days but when I do that it gives me 31/05/2021, which is on the holiday's table but it is not being excluded. I have tried many things but could not find a way around this.