How to find max value within a range with user inputted range size
I think this is a pretty simple question for you pros.
I have a simple data set with 2 columns (call it A1:B20), one column has date, and one has price.
I would like a formula that tells me the max value within x number of days, with a cell where i can enter a new value for X days in the range. I have my day count in C1 and the max value output in C2
Any help would be greatly appreciated.
Posted Mar 6, 2020, 3:54 PM UTC
38
Definitely possible with MAXIFS.
I'd say you need a date range though rather than x number of days. What would an example date range be?
Thanks for responding. The most recent 30 days would be fine.
The real data set is daily financial data and for the last 5 years. Im trying to backtest trading ideas i have, so im not sure entering dates is what im after. I want to say "I have a trading signal in the data, and if this signal had happened in the past, what would my max value be within the next X days".
That's fine, so today essentially would be one date and today -30 would be the other. This would look like this:
(assuming your columns have headers in A1 & B1)
hey sorry for delay in responding. This helped. I appreciate it.
No worries - Glad to be of assistance!
Solution Verified
You have awarded 1 point to Rsl120
^I ^am ^a ^bot, ^please ^contact ^the ^mods ^for ^any ^questions.