excel unique values in range code example Example: count unique values excel =SUMPRODUCT(1/COUNTIF(data,data))