Clean a messy export into a usable sheet with Claude
The struggle: You get an export with duplicate rows and odd dates and cannot use it until it is cleaned by hand.
What you end up with: A clean working tab, an untouched raw tab and a log of every change, ready to export as .xlsx or CSV.
Import the export into Claude Sheets, keep the raw tab as it is, and let Claude clean a copy by rules you approve first. A change log and counts before and after show what happened.
Tools: Claude. Level: Pro. Time: 30 min.
Use it if
- The export comes from an accounting, CRM or payment system
- Dates, amounts or names are in mixed formats
- The same fix has to be repeated every month
Skip it if
- The file has more than the sheet size limit
- You need pivot tables or find and replace, which are not supported yet
What you need first
- Claude Pro, Max, Ultra or Team (Claude Sheets is in beta; on Enterprise an owner must turn it on first)
- The export file (CSV or Excel), with personal data you do not need removed
The method
Import it and freeze the original (Claude: Claude Sheets)
Ask Claude for a sheet, or open the Artifacts tab and pick Sheets. Import your CSV or Excel file. Name the tab Raw and do not edit it.
You get: A Raw tab that holds the original export.
Tip: Keep Raw untouched. It is your proof of what arrived.
Profile the mess before fixing (Claude: Claude Sheets)
Paste the prompt. Read the list and strike out any rule you disagree with before cleaning.
Prompt to copy:
Look at the Raw tab only. List every data problem: duplicate rows, mixed date formats, numbers stored as text, extra spaces, blank key fields, odd values. Give a count and two examples for each, and propose one cleaning rule per problem. Change nothing yet.
You get: A list of problems with counts and the cleaning rule for each.
Tip: Decide yourself which row wins when two rows conflict. Claude should not choose.
Clean a copy by the rules (Claude: Claude Sheets)
Ask Claude to copy Raw into a new tab called Clean and apply only the rules you approved. Ask for a Changes tab as well.
Prompt to copy:
Copy Raw into a new tab called Clean. Apply only these rules: [list the approved rules]. Do not delete a row, mark duplicates in a column instead. Create a Changes tab with rule, number of rows affected and three examples. Report row counts for Raw and Clean.
You get: A Clean tab and a Changes tab that records each fix.
Tip: If a rule feels risky, apply it on ten rows first and look.
Check before you use it (Claude: Claude Sheets)
Compare row counts and the total of an amount column in Raw and Clean. Look at ten random rows side by side. If something is wrong, open version history and restore an earlier version (this also removes every edit made after it), then export as .xlsx or CSV.
Prompt to copy:
Compare Raw and Clean. Report row counts, the sum of [amount column] in each, the number of rows marked as duplicates, and any rows that exist in one tab but not the other.
You get: A cleaned file you trust.
Tip: Restoring a version also removes the later edits, so check right after each big step.
Where this goes wrong
- A sheet can hold up to 100,000 cells, so very large exports need splitting.
- Never let Claude delete rows you have not seen. Mark, do not remove.
- Exports can hold personal data. Remove what the job does not need before you import it.
- Have a qualified person check this before you sign, file or send it.
Sources
More like this
- Pull data from many files into one table
- Variance commentary drafted from your numbers
- Collect, sort and file receipts without a shoebox
Updated . Written with AI help and checked by an independent review step, as described in our editorial standards.