Forum Discussion
tanmanflanjan
Jun 12, 2021Copper Contributor
Help needed: aligning dates in multiple colums.
I'm doing an event study on stock returns. I have created a dataset with stock returns, but because they trade on different exchanges the dates don't always match. Is it possible to align the dates t...
SergeiBaklan
Jun 12, 2021Diamond Contributor
I do not have add-in to play with actual data, thus on such model
DD and Value are arrays returned by formula. Result on the right could be generated by
=LET(d, D6:D22, stockdates, E6#, stockvalues, F6#,
k, SEQUENCE(ROWS(d)),
values, XLOOKUP(INDEX(d,k), INDEX(stockdates, k), stockvalues,,-1),
IF({1,0}, d, values))
Instead of ranges for stockdates and stockvalues you may use your formula. And, in general, there is no need to output dates for each stockvalue.