View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jason[_30_] Jason[_30_] is offline
external usenet poster
 
Posts: 8
Default Counting groups of similar items

Looks like I've made the problem sound a lot easier than it is...
Thanks for all the suggestions so far, but countif on it's own is
definitely not going to work.

I would like to count the number of items in each group. HOWEVER,
because the same spec RE-OCCURS further down the line the countif
statement will include that, whereas I only want to know how many are
in the CURRENT group. Countif in the example below would give a value
of 10 for ?c? when I would like to have it return a value of 3 for the
first group of ?c? and then 7 for the second group of ?c?.

The rows 2 or 3 in my example shows the bare bones of what I would
like to be able to get. Since this is in the programming group I was
hoping to get some assistance towards achieving that more elegant
solution I mentioned where a mouse click on the group would indicate
the total length of that group.

Examples again:

Row 1: a a a a b b b b b c c c a a a a c c c c c c c...
Row 2: 1 2 3 4 1 2 3 4 5 1 2 3 1 2 3 4 1 2 3 4 5 6 7...
Row 3: 4 4 4 4 5 5 5 5 5 3 3 3 4 4 4 4 7 7 7 7 7 7 7...

Row 1 is the row of data I have (dynamic), Rows 2 and 3 show what I
would like to be able to have a formula calculate if the ?elegant?
method is not achievable.

Thanks again,
Jason.