I have a an excel sheet with the following columns ID, City, Record no. I need to generate a column called Next ID based on the record number. ie if the city is same I need to populate the Next ID column with the ID of the previous record number.
Is there a way to do this in excel?
Here is the sample data, with the Next Column populated manually for reference:
ID City Record no. **Next ID
121 Paris 3
122 Paris 2 121
123 Paris 1 122
124 New York 2
125 New York 1 124
Please see attached image
I've edit the question as I was not able to add a image in the comments. My data is not sorted so I used the second formula. This works for some cases but doesn't work for others. see the pink colored cells which should have a value but do not.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.