Everyone has met the spreadsheet that looks fine until you try to use it. Half the dates are text, "Acme Inc", "ACME Inc." and "Acme Incorporated" count as three customers, and the same person appears twice with different spellings.
Cleaning that by hand is slow and boring. AI can do much of it for you, as long as you give it clear instructions and check the results. This guide shows the practical steps, with prompts you can adapt.
Two ways to use AI for spreadsheet cleanup
1. Ask AI for formulas and steps. You describe the problem (or paste a few sample rows) and the AI replies with an Excel formula, a Power Query step or a short script. You apply it yourself. You stay in full control, and it works with any chat assistant.
2. Let an AI tool work on the file. Some tools can read your spreadsheet, apply the fixes across all rows and save a cleaned copy. Orimbo is one example: it works with files and folders you choose, can read spreadsheets, runs multi-step tasks, creates files, and asks before it edits anything. Other assistants with file upload offer something similar, and what each can do depends on the tool and version.
Option 1 is safer for sensitive data and good for learning. Option 2 saves time on large or repetitive jobs. Either way, the steps below are the same.
Before you start: protect your data
- Make a copy. Work on
sales_clean.xlsx, never the original. - Keep the raw data. Put cleaned results in new columns or a new sheet so you can compare.
- Think about privacy. If the sheet contains customer details, health data or anything confidential, check your company's rules and the tool's data policy first. Or paste only a few anonymized sample rows and ask for a formula.
- Add an ID column. A simple row number lets you trace any change back to the original row.
Step 1: Ask the AI to inspect the data first
Don't jump straight to fixing. Ask what is wrong. This catches problems you didn't know about.
Example prompt:
Here are 20 sample rows from my customer sheet (columns: Name, Email, Signup Date, Country, Amount). List every data quality problem you can see: duplicates, inconsistent formats, typos, blanks, text stored as numbers. Don't change anything yet.
If your tool can open the whole file, say so: "Scan all rows and give me a summary of problems per column, with a few examples of each."
You'll often get a list like mixed date formats in one column, trailing spaces in names, and country written three different ways. That list becomes your checklist.
Step 2: Remove duplicates safely
Exact duplicates are easy. Near-duplicates are the real problem: "john.smith@mail.com" and "John.Smith@mail.com ", or the same company with a different suffix.
What to do:
- Trim spaces and normalize case in a helper column first (
=LOWER(TRIM(B2))for emails). - Use that helper column to find duplicates, using Excel's Remove Duplicates, a
COUNTIFcheck orUNIQUE(available in newer Excel versions only). - Flag before deleting. Mark duplicates first and review them.
Example prompt:
I have emails in column B. Give me a formula for column F that returns "DUPLICATE" if the lowercase, trimmed email already appeared in an earlier row, otherwise "OK". I want to review before deleting.
Flagging the later occurrences keeps the first row. But the first row isn't always the best one. If rows differ (one has a phone number, one doesn't), ask the AI to help you merge them rather than delete either.
Step 3: Fix dates that are mixed up
Dates are the most common trouble spot. You might see 03/04/2025, 2025-04-03, April 3, 2025 and 3.4.25 in one column. Some may be real dates and others plain text.
The big trap: 03/04/2025 could be March 4 or April 3. AI can't know which you mean. Tell it.
Example prompt:
Column C has dates in mixed formats. Treat all numeric dates like 03/04/2025 as day/month/year. Give me a formula or Power Query steps that convert everything to real Excel dates formatted as YYYY-MM-DD. List any rows it cannot parse instead of guessing.
Good habits:
- Ask for unparseable rows to be listed, not silently changed.
- Check a few results by hand, especially values where the day is 12 or lower, since those are the ambiguous ones.
- Format the final column as a Date and confirm it sorts correctly. If it sorts alphabetically, it's still text.
Step 4: Standardize names
Names have more variation than people expect: SMITH, john, John Smith, john smith jr., Dr. Jane Doe.
Safe fixes:
- Remove extra spaces with
TRIM. - Split "Last, First" into two columns.
- Apply capitalization.
Be careful with automatic capitalization. Excel's PROPER turns "McDonald" into "Mcdonald" and "van der Berg" into "Van Der Berg". Ask the AI for a rule that handles the exceptions in your data, or accept that a few need manual review.
Example prompt:
Column A has names in mixed formats: "SMITH, john", "Jane Doe", "dr. alan o'neil". Convert them to "First Last" with proper capitalization, keeping apostrophes and prefixes like "van" or "de" lowercase when they are in the middle. Put the result in column B and show me the rows where you were unsure.
The "show me where you were unsure" line matters. It turns a silent guess into a review list.
Step 5: Catch typos and inconsistent categories
Typos in free-text columns (country, city, department, product) break filters and pivot tables. "Untied States", "USA", "U.S." and "United States" should all be one value.
A reliable method:
- Get a list of the unique values in the column (
UNIQUEor a pivot table). - Paste that list, not the whole sheet, into the AI.
- Ask for a mapping table of messy value → standard value.
- Apply the mapping with
XLOOKUPorVLOOKUP.
Example prompt:
Here are the unique values from my Country column, with counts. Create a two-column mapping table: original value → standard country name. Mark any you aren't sure about with "CHECK".
This method is efficient because a column with 10,000 rows might only have 60 distinct values. You review 60 lines, not 10,000, and the mapping table is reusable next month.
Step 6: Handle the small stuff
These quick fixes often matter as much as the big ones:
| Problem | Typical fix |
|---|---|
| Leading/trailing spaces | TRIM |
| Non-printing characters from copy-paste | CLEAN |
| Numbers stored as text | VALUE, or Text to Columns |
| Currency symbols mixed in | Remove symbols, then convert to number |
| Blank cells vs. "N/A" vs. "-" | Pick one convention and replace the rest |
| Phone numbers in different formats | Ask AI for a formula that outputs one format |
If you're not sure which one applies, describe the symptom to the AI: "These numbers are left-aligned and SUM returns 0."
Step 7: Verify before you trust it
AI makes confident mistakes. Run these checks every time:
- Row counts: before and after. If rows disappeared, you should know exactly why.
- Spot-check 15 to 20 rows at random against the original.
- Totals: does the sum of Amount still match?
- Filter each cleaned column and scan the distinct values for leftovers.
- Review the "unsure" list the AI gave you.
If you used a tool that edits files directly, use a mode that asks for approval before changes, so you see what it plans to do. In Orimbo, for example, the default mode asks permission before it edits files, and there's a Plan mode if you want to see the steps first.
Common mistakes to avoid
- Cleaning the only copy of the file. Always keep the original.
- Vague prompts. "Clean this data" gets vague results. Name the columns, formats and rules.
- Not specifying date order. Day/month vs. month/day is the classic silent error.
- Deleting duplicates without looking. Two rows with the same name may be two different people.
- Pasting everything at once. For large sheets, work column by column and test on a sample first.
- Trusting the output blindly. Always run the verification checks above.
A reusable prompt template
Save this and fill in the blanks:
I have a spreadsheet with columns: [list columns]. Here are [N] sample rows: [paste]. Problems I know about: [duplicates in X, mixed dates in Y]. Rules: dates are [DD/MM/YYYY]; keep the first duplicate; don't change anything you're unsure about, list those rows instead. Give me the formulas or steps, one column at a time, and explain how to check the result.
FAQ
Can AI clean an entire Excel file for me?
Often yes, if the tool can open your file, and some can save a cleaned copy. But how well it works depends on the tool, the file size and your instructions. Always check row counts and sample rows afterward.
Is it safe to upload spreadsheets with customer data?
It depends on the data and the tool. Check your organization's policies and the tool's privacy terms. If in doubt, anonymize the data or share only a few sample rows and ask for formulas you can run locally.
Should I use formulas or let the AI edit cells directly?
Formulas are transparent and repeatable, so they suit data you'll clean again each month. Direct edits are faster for one-off jobs. Either way, keep the original and compare.
Conclusion
Cleaning messy Excel data with AI works best as a routine: inspect first, fix one problem type at a time, flag instead of delete, and verify at the end. Give the AI clear rules, especially for date order and duplicates, and ask it to list what it's unsure about. You'll spend your time reviewing a short list instead of fixing thousands of cells by hand.