OK
Assuming that you have moved the ID and Date columns to a new sheet, the following will index that sheet for you. You will need to change the reference for the rngDataTable variable.

VB Code:
  1. Sub GrudgeIndex()
  2. Dim rngDataTable As Range
  3. Dim rngCell As Range
  4.    
  5.     'This is the 2 column range that contains the ID in
  6.     'the first column and the date in the second column
  7.     Set rngDataTable = ThisWorkbook.Worksheets(1).UsedRange
  8.    
  9.     'Note: I'm assuming that the range has already been sorted
  10.     'by ID then Date - If not you should insert a sort here
  11.    
  12.     'Loop through each PatientID cell
  13.     For Each rngCell In rngDataTable.Columns(1).Cells
  14.        
  15.         'I'm assuming that the 1st row contains headers
  16.         If rngCell.Row <> 1 Then
  17.            
  18.             'If the ID is different that the ID on the
  19.             'previous row, or the date is different from
  20.             'the date on the previous row
  21.             'we restart the index at 1
  22.             If rngCell.Value <> rngCell.Offset(-1, 0) _
  23.             Or rngCell.Offset(0, 1) <> rngCell.Offset(-1, 1) Then
  24.                 rngCell.Offset(0, 2).Value = 1
  25.            
  26.             'Otherwise we increment the index by 1
  27.             Else
  28.                 rngCell.Offset(0, 2).Value = rngCell.Offset(-1, 2).Value + 1
  29.             End If
  30.         End If
  31.     Next rngCell
  32.    
  33.    
  34.     Set rngDataTable = Nothing
  35. End Sub