Data > Data cleanup > Remove duplicates keeps the first row it finds and deletes the rest. If your newest record is lower down, that deletes the wrong one. This page shows how to keep the row with the latest date, or the last occurrence, for each key. The formulas leave your original data untouched.
Row 1 holds headers. A2:C6 (Key, Date, Note):
A101, 2026-01-05, first
B202, 2026-02-10, only
A101, 2026-03-15, newest
C303, 2026-01-20, solo
A101, 2026-02-01, middle
The dates are real dates, not text. Wanted result: one row for each key, with the most recent date.
Sort the data newest first, then ask for each unique key. A lookup returns the first row it finds, which after sorting is the newest:
=ARRAYFORMULA(VLOOKUP(UNIQUE(A2:A6),SORT(A2:C6,2,FALSE),{1,2,3},FALSE))
Result, three rows: A101, 2026-03-15, newest; B202, 2026-02-10, only; C303, 2026-01-20, solo. SORT(A2:C6,2,FALSE) sorts by column 2 (Date) from newest to oldest. UNIQUE lists each key once. VLOOKUP with {1,2,3} fetches all three columns. Format the Date column as a date if you see a number such as 46096.
To keep the last occurrence by position instead of by date (the lowest row wins), add the row number as a fourth column and sort on that:
=ARRAYFORMULA(VLOOKUP(UNIQUE(A2:A6),SORT({A2:C6,ROW(A2:A6)},4,FALSE),{1,2,3},FALSE))
Result: A101, 2026-02-01, middle; B202, 2026-02-10, only; C303, 2026-01-20, solo. A101 now shows the row that appears last in the sheet, not the newest date. This method always returns one row per key, even if two rows share a date.
QUERY can group by key and take the maximum date. With the header included, in E1:
=QUERY(A1:B6,"select A, max(B) where A is not null group by A label max(B) 'Latest'",1)
Result: Key, Latest, then A101 2026-03-15, B202 2026-02-10, C303 2026-01-20. This gives only the key and the date. Do not add max(C) to get the note: the maximum of a text column is not the note on the latest row.
To bring the note back, put this in G2 (E2 holds the key and F2 the latest date, so adjust if your QUERY sits elsewhere) and fill down:
=INDEX(FILTER($C$2:$C$6,$A$2:$A$6=E2,$B$2:$B$6=F2),1)
Result: newest, only, solo. INDEX with 1 keeps the first row if two share the latest date.
This keeps whole rows, every column, and removes the older copies:
=FILTER(A2:C6,COUNTIFS(A2:A6,A2:A6,B2:B6,">"&B2:B6)=0)
For each row, COUNTIFS counts the rows with the same key and a later date. FILTER keeps the rows where that count is zero, which means nothing newer exists for that key. Result, in sheet order: B202, 2026-02-10, only; A101, 2026-03-15, newest; C303, 2026-01-20, solo. Wrap it in SORT(...,1,TRUE) to order by key.
A tempting shortcut, FILTER with MAXIFS(B2:B6,A2:A6,A2:A6), does not work: MAXIFS returns a single value there, not one per row, so you only get one row back.
A shorter alternative is SORTN, which sorts newest first and then keeps the first row for each key:
=SORTN(SORT(A2:C6,2,FALSE),9^9,2,1,TRUE)
Result: A101, 2026-03-15, newest; B202, 2026-02-10, only; C303, 2026-01-20, solo.
If two rows for one key share the latest date, both are kept. Use Method 1 if you need exactly one.
In D2, fill down:
=B2=MAXIFS($B$2:$B$100,$A$2:$A$100,A2)
D2:D6 gives FALSE, TRUE, TRUE, TRUE, FALSE. TRUE marks the latest row for each key. Filter the column on TRUE, or use it in a FILTER, and the original data stays editable.
For a one-off clean-up of the real data, not a copy:
Select the data, then Data > Sort range > Advanced range sorting options. Tick "Data has header row", sort by Date, Z to A.
Data > Data cleanup > Remove duplicates. Tick "Data has header row", and untick every column except Key.
Click Remove duplicates. Sheets keeps the first row for each key, which is now the newest.
This deletes rows, so work on a copy of the tab. Undo with Ctrl+Z straight away if it went wrong.
Dates stored as text. "2026-03-15" typed as text sorts as text and MAXIFS ignores it. Check that the cells right-align by default, then convert them with Format > Number > Date.
Trailing spaces in keys. "A101" and "A101 " are different keys. Use Data > Data cleanup > Trim whitespace first.
Case. Some of these functions ignore case and some do not, so make keys consistent first (for example all upper case with UPPER).
Range too short. UNIQUE over a longer range such as A2:A100 returns an empty entry for blank rows, so keep the range to your real data.
Ties. Two rows with the same key and the same latest date: see the notes under Methods 1 and 3.
Disclosure: Snakbacks, the publisher of this site, sells a paid script pack and makes two free add-ons for Google Sheets.
Every method above treats a key as exact. If your "duplicates" are the same customer typed differently, such as "Jon Smith" and "John Smith", none of them will group the rows, and you would keep both. Fuzzy Match Template for Google Sheets (US$9, no add-on install): https://snakback.gumroad.com/l/fuzzy-formulas. Its FUZZYSCORE(a, b) returns a similarity from 0 to 1, so you can build a cleaned key in a helper column and run the formulas above on that. You paste the functions into your sheet once, so it works where a Workspace admin blocks add-ons. There is a 30-day refund if it does not work for you. For clean keys, the free formulas on this page are all you need.
Duplicate Remover: Remove Duplicates in Sheets, our free add-on, is coming soon to the Google Workspace Marketplace.
Need to catch near-duplicates that exact formulas miss, such as "Acme Pty Ltd" and "ACME Pty. Ltd"? The Data Cleanup Kit for Google Sheets (US$15, no add-on install) groups them for you with FUZZYDUPES, and adds ready-made tabs for merging and summing, keeping the latest row, comparing lists, splitting names and cleaning text: https://snakback.gumroad.com/l/data-cleanup-kit
Snakbacks publishes the Duplicate Remover and Fuzzy Match add-ons.