View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jonathan Neubauer[_2_] Jonathan Neubauer[_2_] is offline
external usenet poster
 
Posts: 5
Default Count between Hi and Low

One way that I sole this general problem is in the next available column to
the right I create an index with triggers.. i.e. the following, D2 reffering
the cell in column D next to say, "Low":

D2 = if(C2="Low",1,if(C2="High",-1,0))
D3 = if(C3="Low",1,if(C2="High",-1,0))

E2 = D2
E3 = E2 + D3

F2 = if(E2=1,1,0)
G2 = if(E2=-1,1,0)

Then sum up either F2:F20 or G2:G20 at the end to get the number of rows
between the low to high or high to low.

You can also add triggers so if you only want the first interval or second
interval etc.

Jonathan


"smandula" wrote:

How do I count the rows between Hi and Low stock values?
And Low to Hi.
Col B C
58.0 Low
59.7
63.0 Hi
58.5
60.4
62.2 Low
65.4
63.0
64.3
66.4 Hi
70.0 Hi
66.4
64.0
62.0 Low
Put result in Col D



With Thanks