Find Min and Max in variable length arrays

D

Dave

I have a spreadsheet of 1,247,000 rows displaying prices (Date,
Time,Open,High,Low,Close). I would like to find the lowest Low and the
highest High in various daily time slots (like 937am thru 1017am) to then
test against buying above the highest High and selling below the lowest Low
in the time range selected. I can use Min and Max in fixed array periods but
I stumble badly when I try to make the formula dynamic enough to accept many
different time brackets.
Any help would be greatly appreciated.
Thanks!
Dave LeVeck
 
J

Jacob Skaria

Assuming you have numerics in ColD..(high)..the below array formula will
return the MAX() based on the conditions...Replace the
startdate/time,enddate/time with cell references..Please note that this is an
array formula. You create array formulas in the same way that you create
other formulas, except you press CTRL+SHIFT+ENTER to enter the formula. If
successful in 'Formula Bar' you can notice the curly braces at both ends like
"{=<formula>}"

=MAX(IF((A2:A10>=startdate)*(A2:A10<=endDate)*
(B2:B10>=starttime)*(B2:B10<=endTime),D2:D10))

Replace MAX() with MIN() for the minimum..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top