put name in column A and num in column B, then run this macro
Code:
Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
r = 4
c = 2
Do While Cells(r, 1) <> ""
  If Cells(r, 1) = Cells(r - 1, 1) Then
    c = c + 1
    Cells(r - 1, c) = Cells(r, 2)
    Rows(r).Delete
  Else
    c = 2
    r = r + 1
  End If
Loop
End Sub