Count Changes In An Array Of Data

peterhinton

Active Member
Joined
Mar 8, 2016
Messages
336
so I have some data that records grades of a product in B2:B54

I want to count the number of times the grade has changed,
not the number of different grade it has been (unique values)

example may look like:

A A A A B B B B C C C B B B B C C C......and so on
(range of grades = A-F)

This would equal to 4 changes,

any ideas how to construct such a formula ?
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,
try maybe this (array formula):
Code:
=SUM(IF((B3:B55<>"")*(B2:B54<>B3:B55);1;0))
Best regards :)
 
Upvote 0
Maybe:

=SUMPRODUCT(--($B$2:$B$20<>OFFSET($B$2:$B$20,1,0)),--(OFFSET($B$2:$B$20,1,0)<>""))
 
Upvote 0
This caters for any value in B21

=SUMPRODUCT(--($B$2:$B$20<>OFFSET($B$2:$B$20,1,0)))-($B$20<>$B$21)
 
Upvote 0
Thank You Sir Fish, works perfect,

Thanks for the effort hurgadion, although I could not get this to work, even when changing ; to ,
 
Upvote 0
OK,
I'm sorry... I have to remember about this... I have Local Formulas with ","... My formula works if B54 is empty... My Solution is similar to mikerickson One...
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,426
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top