The formula to count unique numeric values in a range

You have a column contains the price of the product, and you want to count how many product have the same price. This formula is exactly what you want. You can use a formula that uses the FREQUENCY function together with the SUM function to count unique numeric values in a range.


Name Price
1 Banana 1
2 Orange 2
3 Apple 1
4 Pineapple 3
5 watermelon 5
6 Coconut 1

Try formula: =SUM(--(FREQUENCY(A1:A6,A1:A6)>0))

The result is: 3

In this case FREQUENCY function – calculates how often values occur within a range of values, and then returns a vertical array of numbers.

We have the general formula: =SUM(--(FREQUENCY(range,range)>0))