Saturday 15 February 2014

Count Total Unique Values in a Data.

Count Unique Values : - 

Suppose we have a data as shown in below printshot, where we have repeated occurrence of alphabets (A,B,C and D - seven times each as in example ) and we need to count every alphabet only one time. i.e Result should be 4 .


 

So, to count unique values , here is a formula :

{=SUM(1/COUNTIF(DATA,DATA))}

In nutshell , above formula implies fractionate the repeated occurance and then sum it . Like if "A" occurs seven times, then fraction it i.e 1/7 is 0.1428571 and sum it . Since for every "A" in data its fraction should be 0.1428571 and when you sum it 7 times 0.1428571 it obviously would come 1. And same case with other alphabets. Summing all the 1's would give us the result of total unique values in a data.

No comments:

Post a Comment