Hi,
I have my dataset in so called long format, i.e. many individuals with repeated measures and on row for each time point. All variables are in columns.
How can I build a FORMULA to recognize each individual and change of individual. So I need the answer for each row for each time point.

So for instance, to group data, I would like the formula to assign by the last time point (varies between individuals =Dog) if it is a "N" to write "N" for all rows for that Dog and Y if there is one "Y" in the string. In the example above row 5 is the last for Dog "AE1" and the formula should write "N" for all rows 1-5.
For Dog "AE2" it should write "Y" for rows 6-8 and so on.
The same principle should apply for other formulas e.g. to calculate time differnces between rows with first/last visit for each dog as refernce cell.
Hope someone has solved this problem.
The other way is easy, if you have formulas by column you just add arguments and the formula returns the answer in a new COLUMN.