I have data in longitudinal format for patients. Each row denotes a treatment with patient column for Patient ID and date of treatment. I need a formula to work out an ordered count for each patient for their first treatment, second treatment, third treatment etc.
Last edited: