Clean, Standardize, Automate: An AI Workflow for Fixing Messy Spreadsheet Data
Mixed date formats, five spellings of one name, disguised duplicates? Clean messy spreadsheet data with AI and build formulas that maintain themselves.

Ever opened a teammate's sales recap spreadsheet and wanted to close it within two seconds? Dates in three different formats, one customer under five spellings, phone numbers starting with 08 or 62 and studded with dashes. Messy data is not just ugly: every analysis built on top of it skews, duplicates inflate your revenue, and lookup formulas fail silently, without a single error message.
The good news: you don't need to become a data analyst to fix all this. An AI chatbot — ChatGPT, Claude, or Gemini — can work as your personal data janitor. This tutorial walks through a full workflow for cleaning spreadsheet data with AI, from diagnosis to a sheet that maintains itself, with prompts ready to copy. For a medium-sized file the process takes roughly 15-20 minutes; all you need is Google Sheets or Excel plus one AI chat window.
1. Diagnose first: ask AI to map your data's problems
The most common mistake is telling AI to 'just clean this' with zero context. AI first needs to know what's wrong, how bad it is, and what to prioritize. Copy the first 20-30 rows of your data — a representative sample is enough — and paste them into the chat.
Here are 25 rows of my sales data. Columns: Date, Customer Name, Product, Phone, Status, Total.
[paste data here]
1. List every data quality problem you can find.
2. Group them by category: date formats, name consistency, duplicates, empty cells, odd numbers.
3. Rank which issues are most critical to fix first, and explain why.
The result is a problem map: dates Sheets can't read, a dozen possible duplicates, a Total column that secretly mixes text with numbers. That diagnosis becomes the work plan for every step that follows.
2. Standardize column by column, not all at once
Once the problems are mapped, don't ask AI to fix everything in one giant prompt. Work one column at a time so each result is easy to verify, and define the target standard before asking for the formula.
Give me a Google Sheets helper-column formula that standardizes phone numbers in D2:D1500:
- starts with 62 (not 0 or +62), no spaces or dashes
- if the cell is not a number, return the text 'CHECK NUMBER'
Write the formula and explain each part in plain language.
That last sentence is the key. You're not trying to become a formula expert, but a rough grasp of the logic lets you catch it when AI slips up — say, quietly stripping leading zeros that should have stayed.
3. Hunt duplicates: the exact ones and the disguised ones
Identical duplicates don't even need AI: Google Sheets has a built-in tool under Data > Data cleanup > Remove duplicates. The real enemy is the disguised duplicate — 'Berkah Store', 'Berkah Store Main St.', and 'berkahstore' are one customer written three ways. This is where AI shines: it judges similarity of meaning, not just of characters.
Here is the customer name column from my sheet.
[paste unique names, sorted A-Z]
Find pairs that are probably the same entity written differently.
Output a table: original name | likely duplicate | confidence (high/medium/low) | suggested canonical version.
Do not merge anything automatically. Just flag them; I'll decide.
That closing line matters: ask AI to flag, never to merge. Merging customer records has real business consequences, so the execute button stays with you.
4. Build formulas that keep working for new rows
Clean data that instantly gets dirty again is only half the job. Next move: ask AI for formulas that automatically cover new rows, so the sheet stays tidy without manual maintenance.
In the Recap sheet, column C holds product codes like BB-01 and KJ-22.
Write an ARRAYFORMULA that pulls the category name from the Master sheet
based on that code, applies automatically to all new rows without
copy-paste, and writes 'CHECK CODE' when a code is not found.
Say which app and version you use — 'Google Sheets in the browser' or 'Excel 2019' — because modern functions like XLOOKUP don't exist in older Excel. AI will adapt the recipe and offer a fallback when its favorite function isn't available.
5. Lock the door: data validation and conditional formatting
Cleaning without preventing is sweeping the floor during a storm. Two features keep data clean going forward, and AI can write out the full setup steps for both.
The Status column must only contain: To Ship, Shipped, Done, Cancelled.
1. Write exact steps to create a dropdown via data validation in the latest Google Sheets.
2. Create a conditional formatting rule that highlights 'To Ship' rows older than 3 days.
Write out the custom formula in full and suggest a highlight color.
Now nobody who edits the sheet — including you at 5 p.m. on a Friday — can break the standard you just built. While you're at it, ask for anomaly rules too — say, flagging transactions above three times the average for a second look.
6. Crash test: make AI audit your cleaning job
Before you trust the data, have AI double-check it. Paste a summary of the cleaned result and ask for verification from a different angle.
I just cleaned the following sales data.
[paste 20 final rows + the total figure]
1. Look for any inconsistencies I might have missed.
2. Recalculate the total revenue using a different method and compare it with my number.
3. List 5 things I should still check manually before this data goes into a report.
The 'recalculate with a different method' pattern catches silent errors — like a row that accidentally disappeared while you were deleting duplicates.
7. Bonus: the built-in AI column inside Google Sheets
Google Workspace customers with Gemini get an extra shortcut: the =AI() function typed straight into a cell. Your prompt runs row by row, for example:
=AI("Classify this customer feedback into: Shipping, Product Quality, Price, or Other.", C2)
Drag it down or combine it with ARRAYFORMULA and an entire feedback column gets classified without leaving the sheet. Google's official documentation says it can also summarize text, analyze sentiment, and pull real-time information from Google Search. It fits light classification and extraction best, though availability depends on your Workspace plan. For heavy or sensitive jobs, chat prompts with anonymized data remain more flexible.
One privacy note before you paste anything into an AI chat: anonymize first. Swap customer names for codes like CUST-001, trim phone numbers, and drop personal columns the analysis doesn't need. Clean data is good — clean and safe data is non-negotiable.
That's the whole workflow: diagnose, standardize column by column, hunt duplicates, build permanent formulas, lock the sheet with validation, then re-test. You can finish everything this afternoon — without memorizing a single formula.
References
- Use the AI function in Google Sheets — Google's official documentation for the =AI() function
- Google Sheets function list — the official function reference, including the AI category
- XLOOKUP function - Microsoft Support — Microsoft's official XLOOKUP documentation for Excel



