CleanRows · Google Sheets guides

Remove duplicates but keep the last occurrence in Google Sheets

Keep the most recent row for each key (e.g. the latest order per customer) with a helper column and FILTER.

Data in A2:C, key in column A. Helper in D2, fill down — TRUE marks the last occurrence of each key:

=COUNTIF(A3:A,A2)=0

Then list only those rows:

=FILTER(A2:C, D2:D=TRUE)

The built-in Remove duplicates always keeps the first row. CleanRows can keep the last or the most complete row.

Do it in two clicks inside Google Sheets. CleanRows highlights, deletes or moves duplicates by the columns you pick, ignores case/spaces/accents and compares two sheets. Free up to 1,000 rows. Get CleanRows →

More guides

Free online duplicate remover (CSV / list)