Count Consecutive Numbers as 1

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,180
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
What I am trying to do is devise a count that will ignore consecutive values and only count them as one, For example if I had the following numbers 1,5,4,4,4,1,2 my count would be 5, I would count the first 4 but ignore the rest. If I had 1,5,1,5 the count would be 4.

Please note that there could be blanks in the range like 1,5, "",1,5 blanks will be ignored so the count still would be 4.

Thanks in advance Stephen

Book1
ABCDEFGHI
1Counts Desired
215444125
315112126
415154
522332
61511113
71111233
815563
944422222
Sheet1
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I2, control+shift+enter, not just enter, and copy down:

=SUM(IF(A2:G2<>B2:H2,1,0))

This requires column H to be empty.
 
Upvote 0
Thank you Aladin worked great. Thanks again for all your help.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,712
Members
452,939
Latest member
WCrawford

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