• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Counting Rows to Max Value

grumpus

New Member
Suppose you have rows of data and want to find out when the max value was achieved within a range like below. This data could be historical stock prices as an example. So, I know on Day 1 the price was 2.14. I want to put a formula in the next column to calculate the number of days I'd have to wait until it hit the max value for the next 8 days. In this case the answer should be 4 days.

I thought it would be a simple solution, but I can't seem to get it. I know I'll feel silly when I see the answer. Thanks in advance!

2.14
2.15
2.05
2.04
2.23
2.16
2.18
2.22
2.16
 
Hi !

With your sample starting in cell A1,

easy formula is =MATCH(MAX(A1:A9),A1:A9,0)-1
 
Thanks Marc. I knew it had to be something easy but the brain was not working today. I appreciate your time.
 
Back
Top