Counting Occurances

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Try this entered as an array formula with Ctrl-Shift-Enter

List is from A1 to A12

=SUM(IF(ISNUMBER(A1:A12),IF(A1:A12<>A2:A13,1,0),0))-1

With your data I got an answer of 7 ... is this correct?

HTH
 
Please only post to one NG. Thank you!

Toppers said:
Try this entered as an array formula with Ctrl-Shift-Enter

List is from A1 to A12

=SUM(IF(ISNUMBER(A1:A12),IF(A1:A12<>A2:A13,1,0),0))-1

With your data I got an answer of 7 ... is this correct?

HTH
 
Sorry about the multiple posts. How do I get this array to work when there
are spaces in between the rows. Example,
8

9

10

10

11

2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top