Forum Discussion
Denham299
Dec 02, 2022Copper Contributor
International holiday dates confuse MS Stockhistory function
Hi. I am having trouble with a stock list to return prices that are traded on U.S., Canadian & European exchanges. The stockhistory function seems to adjust ONLY for U.S. holidays. E.g. U.S. Thanksgi...
SergeiBaklan
Dec 03, 2022Diamond Contributor
Generating separately dates sequence and stock histories you may combine them in one spill imitating fill down. Something like
=LET(
dates, SEQUENCE(TODAY() - start + 1, , start),
history, STOCKHISTORY(ticker, start, TODAY(), 0, 0, 0, 1),
HSTACK(
dates,
XLOOKUP(
dates,
INDEX(history, 0, 1),
INDEX(history, 0, 2),
,
-1
)
)
)Denham299
Dec 03, 2022Copper Contributor
Sergei. This tests my limits of XL but gives me lots to work on to beef those up. Many thanks.
John