Hello everyone, thanks for the help!

I am working on a data set where I have a date and an ID number (in columns) for many individual observations (in rows). Sometimes the individual was observed only once, and sometimes the individual was observed multiple times. On the individuals that are observed multiple times, I would like to make an indicator variable in a new column where 0 = if the two observations of the same individual are 7 days or less between them and 1 = if the two observations of the same individual are more than 7 days between them.

Is anyone able to help me with a formula or function that can help with this?

Thanks!
--Steve