View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default How do I count crossing zero in a column of integers?

If you values start in A1 going down A25 you can put this in B2 and copy
down along

=AND(A10,A2<0)

will return TRUE when a value changes from 0 to <0

to count it

=SUMPRODUCT(--(A1:A240),--(A2:A25<0))

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey


"suzie" wrote in message
...
I have a very long column of data which moves from positive to negative. I
want to count the occasions where it crosses zero, but am having trouble
writing a formula for this condition. Is there a way I can automatically
compare consecutive cells in the column to identify whether it has changed
from negative to positive?