Is there a way to calculate UNIQUE data?

  • Thread starter Thread starter Mark Livingstone
  • Start date Start date
M

Mark Livingstone

Hi,

Thanks to everyone who has answered to my previous post. It works!

Is there a way I can calculate the number of unique data? For
instance, I have 60 cities. Only 3 of them have different names. How
can assign the number of
these 3 cities to a cell?

Something like in MYSQl: select DISTINCT ... :)

Thank you!
 
=SUMPRODUCT((Range<>"")/COUNTIF(Range,Range&""))

=SUM(IF(Range<>"",1/COUNTIF(Range,Range)))

The latter must be confirmed with control+shift+enter instead of just with
enter.
 
One way to get a distinct count

=SUM(IF(A1:A10<>"",1/(COUNTIF(A1:A10,A1:A10)),0))

entered with ctrl + shift & enter
 
Back
Top