Not pretty:
=SUM(IF(FREQUENCY(F:F,F:F)>0,1))-IF(COUNTIF(F:F,"=0")>0,1,0)
Subtracts 1 if there are any zero values in the list.
I was trying to do it using an AND condition within the sum, but couldn't figure it out.
Question
I'm trying to count the number of unique values in row F in Excel for Mac. F contains a range of ID numbers but sometimes the ID is 0, which I want to ignore.
I'm using this function:
=SUM(IF(FREQUENCY(F:F,F:F)>0,1))
which I adapted from the Microsoft Help page,how do I get it to ignore the zero? I tried taking out and changing the 0 in the function but no luck.
Solution
Not pretty:
=SUM(IF(FREQUENCY(F:F,F:F)>0,1))-IF(COUNTIF(F:F,"=0")>0,1,0)
Subtracts 1 if there are any zero values in the list.
I was trying to do it using an AND condition within the sum, but couldn't figure it out.