I'm assuming from your question that you want to be able to repeat this operation. The UDF below will produce the desired results and the source data does not need to be sorted.
The UDF (User Defined Function) below takes a range of values and creates a list of unique keys along with a count of occurrences of each value. The UDF syntax is:
=Counts(Values)
The function returns an array and so needs to be entered as a multiple cell array formula. To enter the formula, select an area two columns wide and as many rows tall as will be needed to display the results. Enter the formula in the formula bar and press CTRL+SHIFT+ENTER.
Public Function Counts( _
ByVal Values As Variant _
) As Variant
' Produce a tally of all unique keys from the specified key range and, for each, include a
' count of how many times it occurs.
' This is a multiple cell array formula.
' © 2009 Kevin Jones
Dim Result As Variant
Dim Keys As New Collection
Dim Row As Long
Dim Cell As Range
Application.Volatile
ReDim Result(1 To Application.Caller.Rows.Count, 1 To 2)
' Inialize values to empty so errors don't appear in spreadsheet
For Row = 1 To Application.Caller.Rows.Count
Result(Row, 1) = ""
Result(Row, 2) = ""
Next Row
' Create collection of all unique keys
On Error Resume Next
For Each Cell In Values
If Len(Cell) > 0 Then
Keys.Add Cell, CStr(Cell)
End If
Next Cell
On Error GoTo 0
' Set return values
For Row = 1 To Application.Min(UBound(Result, 1), Keys.Count)
Result(Row, 1) = Keys(Row)
Result(Row, 2) = Application.CountIf(Values, Keys(Row))
Next Row
' Add note if destination range not large enough
If Keys.Count > UBound(Result, 1) Then
Result(UBound(Result), 1) = "More..."
Result(UBound(Result), 2) = ""
End If
' Return result
Counts = Result
End Function
Kevin