I have a list of several hundred numbers, with one number added each day. Occasionally a number that is added is higher than all previous numbers. I am interested in calculating the average number of rows between these new record highs.
For example, in the list 0, 3, 5, -1, 0, 4, 9, 8, 7:
-- the new record highs are 3, 5 and 9
-- and the # of rows separating these records are, respectively, 1, 1 and 4 - for an average of (1+1+4)/3=2.
I currently calculate this in the following manner:
The numbers are in range A2:A10.
In cell B2, I have this formula, which I copy down:
=IF(A2=MAX(A$2:A2),ROW()-LOOKUP(2,1/(A1:A$2=LARGE(A1:A$2,1)),ROW(A1:A$2)),"")
And in cell F2, I have this formula:
=AVERAGEIF(B2:B10,">0")
That gives me the correct answer, but I want to eliminate the need for the column of data in column B. In other words, I want to automate this calculation so that with each daily entry in column A, my answer in F2 will be updated automatically.
Any ideas?











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks