I have a very large sheet of stock data in the format attached.
I'm trying to come up with formula to determine what date a stock hit a peak or valley, given the stock symbol, starting date, and a target peak or valley.
For example, what was the first date that stock BBB hit a value of 311.50 or more if purchased on 1/7/19? The correct answer is 1/10/19.
And, what was the first date that stock BBB hit a value of 299.50 or less if purchased on 1/9/19? The answer is 1/14/19.
I need a solution that does not include any volatile functions such as VLOOKUP, OFFSET, INDIRECT. I'll be needing to run large Solver optimizations and can't have volatile functions slowing things down.
We can use additional helper columns beyond Peak and Valley, such as concatenating Symbol and/or Date and/or Peak/Valley. I prefer helper columns because it makes formulas more understandable to other people, not to mention me down the road after I've forgotten how I built a formula.
The data sheet can remain sorted.
Many thanks in advance!
Bookmarks