Clean and tidy data in Excel
Professional structure: role, context, objective, details, steps, format, criteria and self-check. Designed for better results, not guaranteed ones: always review the answer.
Never use real personal data. If you need to, run it through the data cleaner.
## Role Act as a data quality specialist. ## Context I have a messy table with duplicates, dates in several formats and badly typed text. ## Objective Design a repeatable cleaning plan and the formulas or steps to apply it. ## Details (fill in what is in square brackets) - [sample of 10 anonymised rows] - [program: Excel, Sheets or Power Query] - [what the data will be used for] ## Step-by-step instructions 1. Diagnose: duplicates, mixed formats, blanks and odd values. 2. Propose the cleaning order. 3. Give the formula, function or Power Query step for each problem. 4. Explain how to check that no valid data was deleted. ## Output format Diagnosis table (problem, example, fix), numbered steps and a final checklist. ## Quality criteria - No information is removed without warning. - The steps can be repeated next month. - A copy of the original data is kept. ## Self-check Before answering, check every quality criterion. If information is missing, ask me instead of making it up, and at the end state what you have assumed.
Objective
Design a repeatable cleaning plan and the formulas or steps to apply it.
When to use it
This prompt is most useful when you have inherited a messy 'legacy' spreadsheet full of inconsistent entries, such as varying date formats or haphazard casing. It is perfect for preparing data before you build a pivot table or perform a quarterly analysis to ensure better results. However, it is not suitable for unstructured data, like long-form paragraphs or handwritten notes turned into text. If the data is missing more than half its values, a manual review is usually better than an automated cleaning plan.
Worked example: input (fictional data)
Worked example: full response
Variants
Quick Cleanse
Focus only on the three most critical errors that prevent a pivot table from working. Provide a single 'mega-formula' if possible to fix text and spacing in one go, skipping the detailed diagnosis table to save time for a small dataset.
Step-by-Step Beginner Guide
Assume no prior knowledge of Excel functions. Instead of just giving formulas, explain exactly where to click in the Ribbon menu (e.g., Home tab, Editing group). Use very simple language and avoid technical jargon like 'strings' or 'delimiters'.
Power Query Automation
Rewrite the cleaning plan specifically for Power Query. Instead of standard formulas, provide the M-code logic or the specific button sequences in the Query Editor (like 'Capitalize Each Word' or 'Detect Data Type') so the process can be refreshed easily.
Common mistakes
- Pasting real personal data: use an invented sample.
- Working on the original file without a copy.
- Overlooking hidden spaces at the end of cell entries. How to avoid it: Use the TRIM function on all text columns to ensure 'London ' matches 'London' in your filters.
- Deleting rows with missing data without checking their importance. How to avoid it: Filter for blanks first and decide if you can fill them with 'Unknown' or a zero instead of deleting.
- Formatting numbers as text by mistake. How to avoid it: Check that your figures align to the right of the cell; if they stay left, use the VALUE function.
- Failing to account for different regional date settings. How to avoid it: Always verify if 01/02 is 1st February or 2nd January before applying a bulk date transformation to your table.
Related guide
General and assistant-specific tips
Tips by assistant
- ChatGPT: you can attach the file (Excel, CSV or PDF) and ask it to analyse it; ask it to show the calculations it made.
- Gemini: if your plan includes it, you can use it inside Google Docs, Sheets or Gmail without leaving the document.
Getting the most out of it
- Paste the prompt as is and only replace what is in [brackets].
- If the answer does not fit, do not start over: ask for “shorter”, “more formal” or “as a table”.
- Always review the result before using it: AI can get facts, dates or names wrong.
Before you paste it: quick checklist
- Remove client names, amounts and internal data before pasting.
- Say who the text is for and which tone you want.
- Ask for a specific length: “120 words max” or “three bullet points”.
- Read the result aloud and fix anything you wouldn’t say yourself.
How to adapt it to your assistant
The template works the same in ChatGPT, Gemini, Copilot or Claude because it only uses plain language. If your assistant supports fixed instructions (custom instructions, Gems or projects), you can store your preferred tone and format there and paste only the variable part. On a free plan, split long requests into two or three shorter messages.