Counting unique values is a common task in data analysis. You can achieve this easily using the modern UNIQUE function or the classic SUMPRODUCT approach.
Hazlo con IAUsing the UNIQUE function (Excel 365/2021+)
Select a cell and enter '=COUNTA(UNIQUE(range))' to instantly count the unique items in your specified range.
Using the SUMPRODUCT/COUNTIF method (Legacy)
Enter the formula '=SUMPRODUCT(1/COUNTIF(range, range))' to calculate unique values in older versions of Excel.
Verify the results
Press Enter to apply the formula and ensure your range does not contain empty cells, which may cause errors in the legacy formula.
=COUNTA(UNIQUE(A1:A10))Yes, UNIQUE treats an empty cell as a unique value. You can use FILTER to exclude them if needed.