I want a google app script that can delete rows in a spreadsheet which have duplicate values in a specific column (say the very first column being the unique ID). Now, I want it to specifically keep the bottom most duplicate row and delete all the duplicate rows above it.
In the below image, you can see the highlighted ID's are duplicated because their postcode have been changed. I want to keep the very bottom row of the duplicate and delete the top rows. For example, for Lydia and Lizzy, I want to keep rows 9 & 10, which have the most up-to-date postcode and I want to delete rows 2, 5 & 8.
Is there a google app script that can do that?
Here is an example image of what I want to delete:
