Messy Data Ruins Your Analysis? Clean Your Spreadsheet with AI, Step by Step
Duplicates, mixed date formats, inconsistent names: clean a messy spreadsheet with AI in 30 minutes and get it analysis-ready without formula skills.

Every tutorial teaches you how to analyze data with AI. Few talk about the step that comes before: cleaning it. Yet that is where most small businesses actually live. A sales export from your POS app, a payroll sheet, or a customer list from Google Forms usually contains dates in three different formats at once, customer names with inconsistent capitalization, the same person recorded twice under different spellings, and empty cells everywhere. Any analysis built on top of that will miss the mark no matter how good your prompt is: garbage in, garbage out. The good news is that the most tedious part of data work is precisely the part AI handles best. This guide walks through the whole process, from audit to validation, roughly 30 minutes for a mid-sized file. Two rules hold throughout: AI proposes, you decide, and the original file is never touched.
1. Audit First: Ask AI to Map the Damage
Export your data to CSV or XLSX and upload it to ChatGPT, Claude, or Gemini. The first temptation is to ask the AI to clean everything right away. Do not. Start with a diagnosis so you know the scale of the problem.
Here is my sales file from our POS app, CSV format. Do not change anything yet.
Produce a data condition report: row and column counts, the data type of each
column, empty cells per column, columns with inconsistent formats (dates, phone
numbers, names), estimated duplicate rows, and odd values such as negative
prices or outliers. Show it as a summary table plus a priority order for fixes.
This report becomes your work map. The AI often also surfaces problems you never noticed, such as a total column that does not match the sum of its items.
2. Standardize Formats: Dates, Phones, Names, Numbers
The most common problem is mixed formats: a single date column holding 01/02/2025, 1 Feb 2025, and 2025-02-01 at once. Instead of asking the AI to rewrite the whole file, which is hard to audit, ask it to write a Google Sheets or Excel formula that you paste into a new column yourself.
Column C in my Google Sheet has mixed date formats: 01/02/2025, 1 Feb 2025,
and 2025-02-01. Give me a formula I can paste into a new column so everything
becomes consistent YYYY-MM-DD. Explain each function in one sentence and tell
me what happens to rows that fail to convert.
Repeat the same pattern for phone numbers (normalize the country prefix), customer names (TRIM and PROPER), and prices polluted with text like $15,000. Because the formula is visible, colleagues can still inspect the logic.
3. Hunt Duplicates and Near-Duplicates
Exact duplicates are easy; Sheets even has a built-in menu. The sneaky ones are near-duplicates: ACME TRADING, Acme Trading, and Acme Trading Kelapa Gading Branch that may be the same customer. This is where AI beats built-in features: it can suggest a matching strategy, such as using phone numbers or emails as the identity key instead of names.
This file is a customer list that is often recorded twice with different
spellings. Design a duplicate detection strategy: which column is the most
reliable key (name, phone, or email), a Sheets formula that flags likely
duplicates in a new column, and how to merge two rows belonging to the same
person. Run it on the first 20 rows and show me the result before applying
it to the whole file.
That last sentence is the habit worth building: test on a small sample, inspect, then apply at scale.
4. Split or Merge Columns That Are Shaped Wrong
First and last names fused together, addresses in one blob, or a product column holding Coffee Gayo 250g - KG-014. The built-in Text to Columns often fails here because the separator is inconsistent. AI can build a smarter pattern; your job is to supply context.
My product column contains the product name, size, and item code in one cell,
for example: Coffee Gayo 250g - KG-014. Give me three Google Sheets formulas
to split it into Name, Size, and Code columns. Note that product names can
contain numbers too, so do not just cut at the first digit. Also test with
an example that has no code.
Notes like that last sentence are your added value. The AI cannot know that some products lack codes until you tell it.
5. Decide the Fate of Empty Cells Deliberately
Empty cells are a silent trap: blank, zero, and a dash look similar but wreck averages and totals. Do not let the AI fill gaps with invented values; ask for the plan first.
Before cleaning empty cells, propose a plan per column for: City, Email, Price,
and Date of Birth. For each column, recommend whether to fill it (mode, median,
or leave empty), label it UNKNOWN, or leave it untouched, with a one-sentence
reason. Change nothing yet.
Then apply your choices. Rule of thumb: missing identity gets labeled, while missing numbers should not be stuffed with an average if the gap itself is meaningful, for example a customer who has never ordered.
6. Validate: AI Guesses, You Check
A cleanup that fails silently is more dangerous than dirty data, because the error now comes neatly packaged. Close every session with a sanity check.
The data is cleaned. Run validation checks: compare row counts before and
after; sum the Total Price column before and after and explain any difference;
take a random sample of 10 rows and show the before-and-after side by side;
give me 3 COUNTIF formulas to monitor duplicates creeping back into the
original file.
Ten minutes on this step saves you from a report that looks convincing but is wrong. If there is a difference the AI cannot explain, roll back to the backup and redo the problematic part.
7. Save the Recipe: Turn It Into a Cleaning SOP
If similar data arrives monthly, a POS export, payroll, or warehouse stock, do not start from zero. Keep every prompt that worked in one document, then ask the AI to package them into a procedure.
From this session, write a one-page SOP titled Monthly Sales Data Cleaning:
the step order, the final formulas we used, manual checkpoints for humans,
and a list of actions that require confirmation, such as deleting rows.
Format it so I can hand it straight to a new staff member.
To level up, ask the AI to turn repeated steps into a simple Google Apps Script or an Excel macro, so most of next month's cleaning runs automatically with one click.
Clean data never draws applause, but it is the foundation of every analysis, dashboard, and report you build afterward. With AI, the most tedious part of data work turns from an afternoon of frustration into a 30-minute guided conversation. Hold on to three rules: always work on a copy, have the AI propose instead of rewrite, and validate before you use anything. Once the data is clean, move on to the fun part: actually analyzing it.
References
- Data analysis with ChatGPT — OpenAI Help Center — how to upload and analyze CSV and XLSX files.
- Upload files to Claude — Claude Help Center — supported file types and limits.
- Google Sheets function list — Google Docs Editors Help — official docs for TRIM, SPLIT, UNIQUE, REGEXEXTRACT, and COUNTIF.
- OpenRefine Documentation — a dedicated data-cleaning tool for large files.
- pandas Documentation — reference when cleaning runs through AI-generated Python code.



