View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
SteveC
 
Posts: n/a
Default Counting Consecutive Cells

Thanks for trying to figure this out.

Forget everything I just said. Let's start begin this way:

Example 1:
Count the number of times A is in the series A1:E5. You should Count 5.

Col A Col B Col C Col D Col E
Row1 A A
Row2 A
Row3 A
Row4 A
Row5

Example 2:
Now Count the number of consecutive times A appears in the series, starting
from ColA and finishing at ColE. The key word is "consecutive." You should
could count 2. This is because there is no "A" in Col C. The formula should
stop counting everything after the break in the series.

Col A Col B Col C Col D Col E
Row1 A
Row2 A
Row3 A
Row4 A
Row5

My question is, what formula in G1 will count the consecutive number of "As"
in the series A1:E5. That is, what formula will return a value of 2.

Thanks for taking a look...

(this is easily solvable via a sorting macro or multiple vlookups in A1:E5,
but I wanted to see if it's possible in the way described above...)