Hi all, I have two columns of data. The first column is the unique identifier for the subject, the second column is the date of interaction with that subject.
One subject can have several interaction dates. I'm trying to figure out a way to calculate the elapsed days from the first date of interaction to the last, for that subject. I've got MAX(date)-MIN(date), but I can't work out a way to make that calculation relate only to the unique identifier in that dataset.
For example:
1.png
for this example, I manually worked out that the elapsed days for subject 1 is 61, for subject 2 is 50, subject 3 is 44.
I need a formula that will make this calculation per subject in column C, for example:
2.png
Thanks in advance, R
Bookmarks