I'd like to count the occurrence of unique items found in one column of about 120 items. I can't find a way to do this in Numbers.app
-
Currently, if I do this calculation in the footer row, or another table, they both show up as "0" – Greg Kerstine Jul 5 '12 at 23:05
-
Shows up as "0" because I'm not sure how to use the Count function really well. – Greg Kerstine Jul 7 '12 at 23:28
Here is a clever solution posted in an apple discussions thread.
You basically create another column, and use the formula =IF(COUNTIF(A$1:A1, A2)=0,1,"")
. This will display a one for the first occurrence of each unique item. You then simply sum the whole column and you get your count.
-
-
1This is extremely slow when there's lots of data. If that's the case, you can import your data into Google Spreadsheets and use
=COUNTUNIQUE(A:A)
– Eugene Kulabuhov May 31 '17 at 14:04
If it doesn't have to be updated dynamically, you might also copy the cells and run something like pbpaste | sort | uniq | wc -l
.
-
3
-
-
3@CousinCocaine you need
sort
becauseuniq
only detects repeated lines immediately following each other, not repeated lines anywhere in the input stream. Seeuniq
man page. – Fabian Tamp Nov 20 '15 at 4:24 -
1
-
This one is always better than clunky gui, thanks for the reminder bro! – valignatev Jun 1 '17 at 21:09