Clean messy data with clear step-by-step rules

Get a cleaning plan for a messy spreadsheet or CSV, covering duplicates, formats, missing values and typos, plus a script or formulas to apply it.

Published
Works with
ChatGPT, Claude and Gemini
Level
Intermediate
By
GoodAIPromt editorial team

Messy data — duplicate rows, mixed date formats, misspelled city names, blank cells — breaks every analysis that follows. Cleaning by hand is slow and hard to repeat. This prompt inspects a sample and writes clear cleaning rules plus code or formulas you can run on the full file.

The prompt

You are a data analyst. Help me clean this dataset.

What the data is and what I'll use it for: 
Column list with a short description of each: 
A sample of 20–50 rows (including messy ones): 
Tool I'll use: 

Do this:
1. List every data quality problem you see in the sample, by column (duplicates, formats, missing values, typos, outliers, mixed units).
2. Propose a cleaning rule for each, and note any rule that needs my decision (e.g. drop or fill missing values).
3. Write the code or formulas for my tool to apply all rules, with comments.
4. Add checks to run after cleaning (row counts, unique values, ranges).
5. Suggest how to stop the same problems at the source (form validation, drop-down lists).

Never delete data without telling me which rule removes it and how many rows it affects in the sample.

0 of 4 blanks filled

How to use it

  1. Include messy rows in the sample, not just clean ones.
  2. Run the code on a copy of your data first.
  3. Compare row counts before and after cleaning.

Tips

  • Keep the original raw file unchanged.
  • Save the cleaning script so you can rerun it on next month's data.

Frequently asked questions

What does this prompt do?

Get a cleaning plan for a messy spreadsheet or CSV, covering duplicates, formats, missing values and typos, plus a script or formulas to apply it.

Which AI tools does it work with?

It is written for ChatGPT, Claude and Gemini. It also works in other AI tools that accept text prompts, with small changes.

What do I need to fill in?

4 blanks: data and purpose; columns; sample rows; excel, google sheets, python pandas, sql. Click each blue blank on the page, type your details and press Copy prompt.

Is this prompt free to use?

Yes. You can copy and use it for personal and commercial work.

data cleaningcsvspreadsheets

More prompts for ChatGPT, Claude, Gemini.