View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rusty Rusty is offline
external usenet poster
 
Posts: 46
Default Occurance Counting

Thank you Ron! This one worked perfect!

"Ron Coderre" wrote:

Try this ARRAY FORMULA:

For a list of numbers, or blanks, in A2:A11.
A2 must be a number

I think this formula returns the count of number value changes. Also, it
allows for the last items in the list to be blank:

=SUM(--(LOOKUP(SMALL(IF(ISNUMBER(A2:INDEX(A2:A11,MATCH(10 ^99,A2:A11))),ROW(A2:INDEX(A2:A11,MATCH(10^99,A2:A 11)))),ROW(A1:INDEX(A1:INDEX(A2:A11,MATCH(10^99,A2 :A11)),COUNT(A2:INDEX(A2:A11,MATCH(10^99,A2:A11)))-1))),ROW(A2:INDEX(A2:A11,MATCH(10^99,A2:A11))),A2: INDEX(A2:A11,MATCH(10^99,A2:A11)))<LOOKUP(SMALL(I F(ISNUMBER(A3:INDEX(A3:A11,MATCH(10^99,A3:A11))),R OW(A3:INDEX(A3:A11,MATCH(10^99,A3:A11)))),ROW(A1:I NDEX(A1:INDEX(A3:A11,MATCH(10^99,A3:A11)),COUNT(A3 :INDEX(A3:A11,MATCH(10^99,A3:A11)))))),ROW(A3:INDE X(A3:A11,MATCH(10^99,A3:A11))),A3:INDEX(A3:A11,MAT CH(10^99,A3:A11)))))

Note_1: For array formulas, hold down [Ctrl] and [Shift] when you press
[Enter], instead of just pressing [Enter].

Note_2: Since text wrap will surely impact the display, there are NO spaces
in that formula.

(BTW....That's one of the ugliest formula I ever wrote)

Hopefully, somebody will cull that down to something more elegant.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Rusty" wrote:

I really need some help for work. I have a column that contains various
numeric values and I want to count the number of times it changes from one
value to another, but there are spaces in between the cells. Heres a simple
example,
8
8
8
15
15
18
17
17
8
3
17
15
So, is there a formula or macro, something that can sum up the number of
times the number changes?
I would really appreciate the help.