Forum Discussion
Get historical high with StockHistory function
Thanks for your help. The example works.
but I need to get the price for a list of stocks, so I made this formula
=MAX(STOCKHISTORY(A1.[Exchange abbreviation] & ":" & A1.[Ticker symbol],"1/1/1950",TODAY(),0,0,3))
It works for some stock but not all. Most return #N/A error.
I suspect that was because there was no data on 1950.
Is there a way to get from the earliest date that is available?
Since the formula is returning a single cell (thanks to the MAX function), I would just place my multiple tickers in a single column, A1 to A100 (whatever) and copy the formula down in all adjacent rows.
=MAX(STOCKHISTORY(A1,"1/1/1950",TODAY(),0,0,3))
Furthermore, given the general movement of the stock market upward, I can't image why you even need to go back to 1950 for any individual stock that is currently traded. That couldn't be the cause of the #NA error; after all TSLA worked and it didn't even exist until far more recently than that.
Something like that. I haven't tested it, but see no reason why that wouldn't work for symbols that are active.
- CALVIN2021Jan 10, 2021Copper Contributor
I found out the #Value error occurred because there was an #N/A error for one of the dates, which I don't know why it happens. So I am trying to exclude errors in a set of data when calculating the MAX.
I made the following formula but it does not work. Could you help?
=AGGREGATE(4,6,STOCKHISTORY(D17,"1/1/1950",TODAY(),2,0,3))
Example stock: XNYS:FOUR