Along the same line, how would I combine the unique values into 1 string such as "4, 5, 6, 7, q, e, r, 9" The order does not matter to much, but I would like it to order in the way the values are found in the column or range.
If you download and install the free morefunc.xll add-in...
=SUBSTITUTE(TRIM(MCONCAT(UNIQUEVALUES(A2:A11)," "))," ",", ")
BTW, just to set the record straight regarding 'unique item count'...
1]
=SUM(IF(FREQUENCY(A2:A7,A2:A7),1))
will calculate a unique count of numbers. It will disregard the non-numbers. (Your original question as stated involved 'numbers')
2]
=SUM(1/COUNTIF(A2:A7,A2:A7))
Requires control+shift+enter.
3]
=SUMPRODUCT((A2:A7<>"")/COUNTIF(A2:A7,A2:A7&"")
Here are some links on [2] and [3]...
http://www.mrexcel.com/board2/viewtopic.php?t=37550&highlight=token
http://www.mrexcel.com/board2/viewtopic.php?t=17071&highlight=hager
http://www.mrexcel.com/board2/viewtopic.php?t=73502&highlight=grove
4] With a function from the free morefunc.xll add-in...
=COUNTDIFF(A2:A7,,"")
which is case-sensitive.
5] Latest on the subject...
=SUM(IF(FREQUENCY(IF(A2:A7<>"",MATCH("~"&A2:A7,A2:A7&"",0)),ROW(A2:A7)-ROW(A2)+1),1))
Requires control+shift+enter.
[5] is designed to circumvent some of the issues that turn up with items containing symbols with special meaning (like < ), although it doesn't resolve all of them.
I might add that [4] is the best and the fastest.
BTW, the above does not list some formulas that invoke FREQUENCY and MATCH...