# Remove duplicate rows in Excel, including the ones it misses

> Markdown version of https://stella.sh/how/pdf-excel/remove-duplicate-rows-in-excel for agents and LLMs.
> Remove Duplicates misses copies that differ by capitals or spaces. Normalise first with LOWER and TRIM, or let Stella (stella.sh) make a clean copy, one row per person.

Data, Remove Duplicates only removes rows that match exactly, so “Jo@Mail.com ” and “jo@mail.com” both stay. Add a helper column with `=LOWER(TRIM(C2))` on the email, then run Remove Duplicates on that column only, on a copy of the file. Stella (stella.sh) makes a clean copy where each email appears once, keeps the details from whichever duplicate had them, and keeps different people who share a name.

- Checked: 13 November 2026
- Stella does it on: Windows, Mac, Linux

## Stella doing it

Recorded 13 November 2026 on Linux (Omarchy) with Claude Code with Opus, on a Claude plan.
Result: 180 people from 229 rows in under 2 minutes. Checked afterwards against an answer key written before the run: exactly 180 people, everyone still there, nobody twice, both Sam Taylors kept, no phone number lost when only a duplicate had it, emails tidied, and the original list unchanged. The newsletter, its subscribers and their details are fictitious, made for this run. The work is sped up 5×.

Video (48 s): https://stella.sh/media/proofs/pdf-excel/remove-duplicate-rows-in-excel/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer. A newsletter mailing list with many people on it twice is in Documents.
- 0:01 The prompt: a clean copy with everyone on it once.
- 0:15 Stella replies that it will treat emails differing only by capitals or spaces as one person and leave the original alone.
- 0:21 Finding and merging duplicates, sped up 5×.
- 0:33 Done: 180 people, down from 229, emails tidied, phone numbers kept, and names to check.

What Stella does:

1. Opens the mailing list in Documents (229 rows) and treats emails that differ only by capitals or spaces as the same person
2. Merges each person's copies into one row, keeping the phone number from whichever copy had it and the name that isn't in all capitals
3. Keeps each person's earliest sign-up date, which also dropped five dates set in the future
4. Keeps people who share a name but have different emails, such as two Sam Taylors, as separate people
5. Saves “Newsletter mailing list (deduplicated).xlsx” next to the original, with emails tidied to lower case, and lists names worth a human look

## The prompt to paste

```text
My newsletter mailing list spreadsheet in Documents has loads of people on it twice, sometimes with their email in capitals or with a space in it. Make me a clean copy where everyone is only on it once.
```

## Remove them yourself in Excel

1. **Work on a copy.** Save the file under a new name first. Remove Duplicates deletes rows, and once you save there's no undo.
2. **Decide what makes a duplicate.** For a mailing list, the email address. Names aren't safe: two different people can share one. Dates and phone formats vary between copies of the same person.
3. **Add a clean key column.** Next to the data, add a column with `=LOWER(TRIM(C2))` (C being the email) and fill it down. This removes leading and trailing spaces and capitals. For spaces inside an email, wrap it in `SUBSTITUTE(…," ","")`.
4. **Keep the best copy.** Sort so the most complete copy of each person comes first (for example, sort the Phone column so filled cells come before blanks). Remove Duplicates keeps the first row it meets.
5. **Remove Duplicates on the key.** Select the data, Data, Remove Duplicates, untick every column except the key, and click OK. Excel says how many it removed. Delete the key column after, or keep it to check.

## Where Stella stops

- Stella decided who is the same person by email address. People with no email, or one person with two addresses, need a rule from you; it listed eight same-name, different-email pairs rather than guess.
- It made a copy and left the original as it was. Ask for the duplicates on a separate tab if you want to see what was merged.
- The list's names, emails and phone numbers go to the AI model you use in Stella. The clean-up runs on your computer.
- Recorded on Linux with a free Python library; the clean copy is a normal .xlsx for Excel or Numbers. The same works for CSV files.

## Questions

**Why isn't Remove Duplicates removing my duplicates?**
The rows aren't exactly the same: a capital letter, a space or a different phone format makes Excel treat them as different. Normalise a key column first (above).

**How do I remove duplicates based on one column?**
In the Remove Duplicates box, untick every column except that one. Excel keeps the first row for each value and deletes the rest of the row.

**How do I just highlight duplicates instead?**
Home, Conditional Formatting, Highlight Cells Rules, Duplicate Values. It has the same exact-match limit, so use the clean key column.

**Can I combine two lists and then de-duplicate?**
Yes: [combine the files into one sheet](https://stella.sh/how/pdf-excel/combine-excel-files-into-one-sheet) first.

**Is Stella free for this?**
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.

**Can I control what Stella changes on my computer?**
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.

Sources: [Microsoft: Filter for unique values or remove duplicate values](https://support.microsoft.com/en-us/topic/ccf664b0-81d6-449b-bbe1-8daaec1e83c2).

## Related problems

- [Merge two Excel sheets based on one matching column](https://stella.sh/how/pdf-excel/merge-two-spreadsheets-by-matching-column.md)
- [Combine multiple Excel files into one sheet](https://stella.sh/how/pdf-excel/combine-excel-files-into-one-sheet.md)
- [Compare two Excel sheets and list what changed](https://stella.sh/how/pdf-excel/compare-two-excel-files.md)
- [Convert bank statement PDFs to Excel](https://stella.sh/how/pdf-excel/bank-statement-pdf-to-excel.md)
- [Reduce PDF file size when it's too large to email](https://stella.sh/how/pdf-excel/compress-pdf-too-large-to-email.md)
- [Turn receipts into a spreadsheet for your expense report](https://stella.sh/how/pdf-excel/receipts-to-spreadsheet.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
