# Need help making a countif

#### shivakanou

##### New Member
Hello everybody!

I need help to tune my countif formula, it's something basic, but as it's not something taught by simple excel courses I'm a little bit lost.

I have a column (range C2:C288), where all the cells have the following formula:
Code:
``=IF(COUNTIF(B:B;B2)=1;B2;"")``
So it will look up the column and give me only the distinct values.
Now I need to make a countif to return me how many values are distinct.

Obs 1: I had to use this count if formula
Code:
``=IF(COUNTIF(B:B;B2)=1;B2;"")``
Because it was the only formula that returned the first distinct value, other formulas, like
Code:
``=IF(A2="";"";IF(COUNTIF(\$A3:A288;A2)=1;A2;""))``
Would return the last distinct, I don't know why.

Problem: As the "empty" cells still have a hidden formula, the formula
Code:
``=COUNTIF(\$C2:\$C288;"<>"&"")``
Returns the total amount of cells (287)

 Solution: Threat code cells as empty, but I don't know how Could you guys give me a hand? Thank you!

<tbody>
</tbody>

### Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Maybe...

=SUMPRODUCT(--(C2:C288<>""))

Hope this helps

M.

Maybe...

=SUMPRODUCT(--(C2:C288<>""))

Hope this helps

M.

Sorry to ask you this but, what doest <> means?

<> means "not equal to"

Replies
3
Views
187
Replies
1
Views
547
Replies
1
Views
172
Replies
3
Views
534
Replies
15
Views
482

### Forum statistics

1,196,462
Messages
6,015,385
Members
441,889
Latest member
balolaptopgiaolong

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