# Count cells with different values

#### cabete

##### New Member
Hello everyone.
I am trying to make a formula but i am not successful until now.

What i am try.
I want count the number of changes over on a plant. This value from C1 ,C2, C3 are came from a combobox are can be from 1 to 25

I will give a example:

C1 "1"
C2 "1"
C3 "1"

This ( Means i don't have changeovers and the line are not planned)

If i have :

C1 "2"
C2 "1"
C3 "1"

I have 1 changeover.

If i have :

C1 "2"
C2 "4"
C3 "1"

I have 2 changeover.

Can someone help me to do a formula, i have try the countif(C1,C2) but this just count if they are equal.

=IF(COUNTIF(C1:C3,C1:C3)=3,0,IF(COUNTIF(C1:C3,C1:C3)=1,2,1)) but not give what i want.
Any subjection???

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try...

=SUMPRODUCT(1-(C1:C2=C2:C3))

Sorry my mistake when i has translating.

will give a example:

C1 "1"
C2 "1"
C3 "1"

This ( Means i don't have changeovers and the line are not planned)

If i have :

C1 "2"
C2 "1"
C3 "1"

I have 0 changeover.

If i have :

C1 "2"
C2 "4"
C3 "1"

I have 1 changeover.

If i have :

C1 "2"
C2 "4"
C3 "10"

I have 2 changeover.

Is it

=SUMPRODUCT(1-(C1:C2=C2:C3))-1

then?

No there is not what i want.

Replies
16
Views
492
Replies
3
Views
132
Replies
2
Views
159
Replies
2
Views
146
Replies
8
Views
279

1,203,213
Messages
6,054,200
Members
444,708
Latest member
David R__

### 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.

### Which adblocker are you using?

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

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