Topic 2 of 5 · 4 min read
Spreadsheet cleanup with AI help
Goal: Ask an assistant for cleanup steps, apply them on a copy of the sheet and confirm the row count changed only as expected.
Do cleanup on a copy of the sheet, ask for one change at a time, and compare row counts and a few sample rows before and after.
Check yourself · 1 of 3
Before removing duplicates from a customer sheet with 1,200 rows, what should you do first?
Why it matters
Messy data is the most common spreadsheet problem: names in mixed case, trailing spaces, a full name in one column, the same customer entered twice. AI assistants are good at suggesting the steps and writing the formulas. But cleanup changes your data, and some changes cannot be undone after you save. A cleanup that quietly deletes the wrong rows is worse than a messy sheet.
How to do it
- Work on a copy. Duplicate the sheet or the file first. Keep the original untouched.
- Write down the counts. Before you start, note the number of rows, and the number of distinct values in the key column.
- Describe the mess with examples. Paste five real, messy cells into your request. "Names look like ' smith, ANA ' and 'Ana Smith'" is much clearer than "names are messy".
- Ask for one fix at a time. Trim spaces, then fix case, then split the column, then remove duplicates. If something goes wrong you know which step did it.
- Define a duplicate. Two rows are duplicates when which columns match? Email only, or name and date? The assistant will pick one if you do not.
- Check counts after each step. Trimming and case changes must not change the row count. Removing duplicates should drop it by about the number you expected.
Before and after
Before: Clean up my customer list.
After: On a copy of the sheet, in column B, remove leading and trailing spaces and make the names proper case. Do not change any other column and do not delete rows. Examples: ' smith, ANA ' should become 'Smith, Ana'.
Then check: the sheet had 1,200 rows before, and it must still have 1,200 rows after this step.
What goes wrong
- Proper case breaks real names. 'McDonald' becomes 'Mcdonald', and 'van der Berg' gets capital letters it should not have. Spot-check unusual names.
- Duplicates are removed on the wrong key. Two different people with the same first name and the same city are merged because only those columns were compared.
- Numbers and dates are altered. A split on a comma also cuts a value like 1,250.50, or a leading zero in a postcode disappears.
Some tools can run these steps for you. Others only describe them. In both cases, the row count and a handful of sample rows are your proof that it worked.
Examples
Row counts across four steps
| Step | Rows after | Expected? |
|---|---|---|
| Start | 1,200 | n/a |
| Trim spaces | 1,200 | Yes, no rows should go |
| Proper case | 1,200 | Yes |
| Remove duplicates by email | 1,148 | Plausible: 52 repeats |
If the trim step had shown 1,170, a step deleted rows and you stop and look.
Splitting a full name
Request: In column B the names look like 'Smith, Ana' and 'Ana Smith'. Put the first name in column C and the last name in column D, leave B as it is, and list any rows where you were not sure.
The last instruction matters: it makes the assistant show its doubtful rows instead of hiding them.
Key points
- Always clean a copy and keep the original sheet untouched.
- Record the row count and the count of distinct key values before you start.
- Paste real messy examples into the request so the assistant sees the actual patterns.
- Ask for one change at a time, and say which columns define a duplicate.
- Trim and case steps must keep the row count unchanged; only duplicate removal should reduce it.
Common mistakes
- Cleaning the only copy of the data, then saving over it.
- Asking for all cleanup in one request and not knowing which step broke a row.
- Letting the assistant decide what counts as a duplicate.
- Checking that the sheet looks neat but not checking the row count.
Check yourself · 2 of 3
After you trim spaces in a name column, the sheet has 1,170 rows where it had 1,200. What does that tell you?
Check yourself · 3 of 3
You want an assistant to remove duplicate customers. Which instruction is clearest?
Practice items, not counted towards your mastery.
Start here
- Get started with Copilot in Excel (opens in a new tab)DocsFree
Microsoft's entry page for the Copilot pane: what it can do with formulas, tables and analysis.
- COPILOT function (Excel) (opens in a new tab)DocsFree
Microsoft's page on the in-cell COPILOT function, including its removal on 14 September 2026 and what happens to old results.
- Gemini in Google Sheets (opens in a new tab)ArticleFree
Google's overview of Gemini features in Sheets, the other main assistant this skill covers.