Count Unique Values in Excel
This example shows you how to create an array formula that counts unique values.
Examples:
1.. To count the number of 5’s, use the following function.
We use the COUNTIF function.
3. Finish by pressing CTRL + SHIFT + ENTER.
Note: The formula bar indicates that this is an array formula by enclosing it in curly braces {}. Do not type these yourself. They will disappear when you edit the formula.
Explanation: The range (array constant) created by the COUNTIF function is stored in Excel’s memory, not in a range. The array constant looks as follows:
{3;1;1;1;3;3}
– (three 7’s, one sun, one moon, one 5, three 7’s, three 7’s)
This reduces to:
{1/3;1/1;1/1;1/1;1/3;1/3}
This array constant is used as an argument for the SUM function, giving a result of 1/3+1+1+1+1/3+1/3 = 4.