Thursday, 3 Dec 2026 Global Edition
Live Wire
AI Today Daily AI journalism & intelligence
Front Page Tips & Tutorials Baca versi Indonesia

Before the Analysis Starts: Cleaning Messy Spreadsheets with AI Chat

Duplicates, messy formats, and blank cells devour analysis time. Clean your spreadsheet with AI chat in five steps: ready-to-use prompts included.

Before the Analysis Starts: Cleaning Messy Spreadsheets with AI Chat

You just exported sales data from your POS app or inherited an Excel file from a departing colleague. Open it and the scene is familiar: customer names written five different ways, dates mixing local and international formats, a cell cramming a name plus an email address, rows appearing twice. Before a single chart can be built, the afternoon is gone — and all you did was clean up.

Anaconda's 2020 State of Data Science report found that data practitioners spend roughly 45 percent of their working time just loading and cleaning data — longer than the analysis itself. The good news: this most boring of data jobs can now be shortened with an AI chat. This guide walks through five cleaning steps, ready-to-use prompts included, so your data is analysis-ready in minutes.

One note first: this is not an analysis tutorial. We focus on the stage before it — a foundation so the numbers you produce later can be trusted.

1. Recognize the Four Faces of Dirty Data Before Typing Any Prompt

Your opponent usually comes in four forms: duplicate rows, inconsistent formats, broken column structure, and blank cells — exports from apps tend to carry all of them at once.

The most common mistake is asking the AI to clean everything at once. What saves you is an audit: paste a sample and have the AI inventory the problems without changing anything.

I am pasting the first 20 rows of my sales data below.
Your task is ONLY to audit, not to clean:
1. List the data quality problems you find
   (duplicates, inconsistent formats, blanks, column structure).
2. For each problem, point to example rows and column names.
3. Propose the safest cleaning order.
[data here]

Auditing first keeps you in control; the AI cannot tidy up your data in ways you never agreed to.

2. Hunt Duplicates, but Tell the Legitimate Ones Apart

Duplicates are the sneakiest enemy: sales figures silently inflate. Not every twin row is a duplicate, though — a customer can genuinely buy twice in one day; those are two valid transactions.

Ask the AI to work as a detective, not an eraser:

Find rows that are potential duplicates based on the combination
of name + date + amount. DO NOT delete anything.
Show a table with: the original row, its twin, and your reasoning.
Rows you are unsure about: mark as needs-human-confirmation.

Once the list is out, you decide which are true duplicates. For thousands of rows, ask the AI to generate a UNIQUE formula in Google Sheets or an Excel Remove Duplicates rule, so the cleanup can be rerun anytime.

3. Standardize Formats: Dates, Names, and Phone Numbers

Messy formats are the top reason sorts and charts break. One date column holds 05/12/2024, May 12 2024, and 2024-05-12 at once; a company appears as Acme Inc., acme inc, and ACME INC; phone numbers mix 0812 and +62812.

The key: ask the AI to show a mapping first, not the final result. Ambiguous dates like 03/04 must never be guessed:

My Date column mixes formats: 05/12/2024, May 12 2024,
2024-05-12. Convert everything to ISO format (YYYY-MM-DD).
Before writing the final result, show a mapping table
(old value -> new value). Ambiguous dates like 03/04:
do not guess — flag as needs confirmation.

The same pattern applies to names and phone numbers: have the AI draft normalization rules, show before-and-after samples, and apply them to the whole column only after approval. Gemini in Google Sheets and Copilot in Excel run some of this inside the spreadsheet, but going through chat leaves you reusable rules for the next export.

4. Fix the Structure: Split, Merge, and Rearrange Columns

Sometimes the content is right but the shape is wrong: name, email, and phone squeezed into one cell; column headers stuck on the third row of an export; or merged cells that jam your filters.

For splitting columns, ask the AI to build a reusable tool rather than a one-off result:

My Customer column contains: Budi Santoso ([email protected], 0812-3456-7890).
Give me a Google Sheets formula to split it into three columns:
name, email, phone. If the formula gets too convoluted, write a
simple Apps Script I can run from the Extensions menu.

This becomes mandatory at scale: 200 rows by hand is plausible; 20,000 need a formula or script. Bonus: when next month's export arrives with the same pattern, you just rerun the tool you already built.

5. Handle Blank Cells with Strategy, Not Guesswork

Blank cells invite the most dangerous AI behavior: filling in values that seem reasonable. Missing data is an analytical decision, not a chore the AI may settle on its own.

The City column has 120 blanks out of 1,500 rows; Discount has 300.
My analysis goal: average transaction value per city.
Explain the risk of each option — leave blank, fill with Unknown,
or infer from other data. Recommend per column, then WAIT for my
approval before changing anything.

AI is great at mapping options and consequences — warning that filling blank Discounts with zero will artificially drag the average down. The final call is yours: you understand the business context.

6. Verify Like an Auditor: Copy, Log Changes, Spot-Check

This is the golden rule that separates professional cleaning from recklessness: the AI must never modify your data silently. Three habits are mandatory.

First, always work on a copy; the original stays untouched. Second, request a change log in every cleaning session. Third, reconcile key numbers before and after — total sales, for instance — because a total that shifts without explanation is the loudest alarm.

Before delivering the clean output, produce a change log:
initial row count vs final row count, cells changed per category,
10 random before -> after examples, and whether any totals
changed, with the reason.

Finally, pull ten random rows and check them against the original. Five minutes of checking beats presenting a strategy built on wrong numbers.

7. Turn It into a Routine: One Master Prompt for Your Next Export

If weekly or monthly exports keep arriving, stop composing prompts from scratch. Assemble one master prompt and save it in your notes or the custom instructions feature of your chatbot:

You are a data cleaning assistant. Whenever I paste data:
1. Audit first, change nothing.
2. Propose a cleaning plan and its risks.
3. Wait for my approval.
4. Execute with a full change log.
Our format standards: ISO dates, +62 phone prefix, title-case
names. Alert me when you spot a new pattern.

With this routine, data cleaning turns from an all-afternoon chore into a fifteen-minute process you can delegate. And once the data is clean, every analysis and visualization trick finally has a foundation you can trust — even the smartest decision collapses on top of dirty data.

References

Partner Spotlight Explore today’s curated technology offers