Counting how many rows since a new value was made

R

rhhince

I am trying to figure out how to count automatically how many periods
ago the highest high was made without manually counting represented by
the 5th column. Example: 30.3125 was the highest high 2 days ago based
on a 6 day max represented in the 4th column. The max function is
easy; counting how many rows ago since it was hit is another. If a new
high was just made it starts at zero. By the way, I am trying to build
an aroon indicator for forex trading, and this is part of the process.
Any formulas would be greatly appreciated. Thanx!


Date High Low Highest
High

10/01/98 27.5000 26.2188
10/02/98 28.1250 26.3125
10/05/98 29.0000 26.9062
10/06/98 30.3125 29.1875
10/07/98 29.7500 29.1875
10/08/98 28.5625 26.5938 30.3125 2
10/09/98 29.8125 27.8750 30.3125 3
10/12/98 30.9688 30.2500 30.9688 0
10/13/98 30.5938 29.7500 30.9688 1
10/14/98 31.1250 29.8125 31.1250 0
10/15/98 32.5000 30.4062 32.5000 0
10/16/98 33.8438 32.8438 33.8438 0
10/19/98 34.4688 33.8125 34.4688 0
10/20/98 34.7188 32.6875 34.7188 0
10/21/98 33.0312 32.2812 34.7188 1
10/22/98 33.6250 32.2812 34.7188 2
10/23/98 34.0000 32.9375 34.7188 3
10/26/98 33.8125 32.6875 34.7188 4
10/27/98 33.1562 31.5000 34.7188 5
10/28/98 32.9688 31.3750 34.0000 3
10/29/98 33.8125 32.6562 34.0000 4
10/30/98 34.7188 33.7188 34.7188 0
 
S

Sandy Mann

If you mean highest for the last six entries then with the headers in Row 1
ans the data in A2:C23 try;

Highest (in D7): =INDEX(B2:B7,MATCH(MAX(B2:B7),B2:B7,0))

No of entries ago (in E7): =6-MATCH(F7,B2:B7,0)

and copy both formulas down

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 

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