Need help making a countif

shivakanou

New Member
Joined
May 19, 2015
Messages
8
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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,872
Messages
6,122,025
Members
449,060
Latest member
LinusJE

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