I need to count unique values in range (C2:C2080) in excel. Googled formula:
=SUM(IF(FREQUENCY(MATCH(C2:C2080;C2:C2080;0);MATCH(C2:C280;C2:C2080;0))>0;1))
=SUM(IF(FREQUENCY(IF(LEN(A2:A10)>0,MATCH(A2:A10,A2:A10,0),""), IF(LEN(A2:A10)>0,MATCH(A2:A10,A2:A10,0),""))>0,1))
http://office.microsoft.com/en-us/excel/HP030561181033.aspx
You may also write a VBA macro (not sure if that's what you're after though.)
Something to the effect of (given a spreadsheet with A1-A11 filled and B1-B11 empty):
Sub CountUnique()
Dim count As Integer
Dim i, c, j As Integer
c = 0
count = 0
For i = 1 To 11
Sheet1.Cells(i, 2).Value = Sheet1.Cells(i, 1).Value
c = c + 1
For j = 1 To c
If CDbl(Sheet1.Cells(i, 1).Value) = CDbl(Sheet1.Cells(j, 2).Value) Then
c = c - 1
Exit For
End If
Next j
Next i
' c now equals the unique item count put in the 12'th row
Sheet1.Cells(12, 1).Value = c
End Sub