Thank you. How do i modifiy this so that when a new row is added with another unique column, this formula will automatically increase the sum by 1 (or if it is not unique, stay the same)??
If you are on Excel 2003, convert the range into a list. If on 2007 or later, you can convert the range into a table. Both functionality allows the formula to adjust to changes in the range.
Otherwise, on all versions...
Control+shift+enter, not just enter:
=SUM(IF(FREQUENCY(IF(USED(A:A)<>"",MATCH("~"&USED(A:A),USED(A:A)&"",0)),ROW(USED(A:A))-MIN(ROW(USED(A:A)))+1),1))
The following udf defines the USED function, which you need to add to your workbook as a module:
Function Used(r As Range) As Range
'
' Harlan
Grove
' Sun 25 Nov 01
'
Dim q As Range
Set q = r.Parent.UsedRange.Cells(r.Parent.UsedRange.Cells.Count)
Set Used = Intersect(r, r.Parent.Range(r.Parent.Cells(1, 1), q))
End Function