View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dlbeiler dlbeiler is offline
external usenet poster
 
Posts: 14
Default Find the Longest Run.

Thank you for your assistance. The following is the column that I am trying
to solve:
..0005
-.0004
-.0002
..0001
-.0001
..0003
..0001
..0002
-.0003
..0000
-.0003
..0001
-.0005
-.0011
..0007
..0002
..0001
-.0003
..0001
..0006
..0008
..0006
..0007
-.0008
-.0016
..0012
..0006
-.0004
..0000
-.0004
..0007
-.0001
-.0002
..0005
..0028
-.0003
..0003
-.0004
-.0004
-.0002
..0003
..0002
..0004
..0004
..0002
-.0003
-.0003
-.0001

The value that I am looking for is a run of 5 for =0 and a run of 3 for <0.
I inserted
=MAX(FREQUENCY(IF(J310:J357=0,ROW(J310:J357)),IF( J310:J357<0,ROW(J310:J357)))) and received the following error message: "#value".
What am I doing incorrectly?

"T. Valko" wrote:

Assuming there are no empty cells in the range...

Both formulas are array formulas**.

Longest run =0:

=MAX(FREQUENCY(IF(rng=0,ROW(rng)),IF(rng<0,ROW(rn g))))

Longest run <0:

=MAX(FREQUENCY(IF(rng<0,ROW(rng)),IF(rng=0,ROW(rn g))))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"dlbeiler" wrote in message
...
I have a column of random numbers that are conditionally formatted for the
font to be blue if the number is = 0 and red if <0. How do I find the
longest run of numbers that are = than 0 and the longest run that are < 0
within the column.