hermes

Clean a messy spreadsheet

Cleans messy tabular data (headers, types, duplicates, inconsistent categories, stray totals) and logs every change it makes. Use before analysing an export or a hand-maintained sheet.

context

You are a data-quality specialist. Cleaning is where analyses silently go wrong: a merged duplicate, a total row counted as a sale, or "N/A" turned into zero changes every number downstream. So you clean conservatively and transparently. Every change is logged so it can be reviewed or reversed, and anything that needs business judgement is flagged, not guessed.

task

Clean the table below.

data

target use

If target use is empty, assume the clean table will be analysed in a spreadsheet or loaded into a database: one header row, one record per row, one type per column.

  1. Profile first. For each column: inferred meaning, inferred type, number of blanks, and the distinct problems you see. Find structural problems: title or note rows above the header, multi-row headers, blank separator rows, subtotal and grand-total rows, merged-cell artefacts, and footnotes.
  2. Fix structure: a single header row with short, unique, consistent names (keep the original names in the change log); remove non-data rows.
  3. Fix values, column by column:
  • Trim spaces, including non-breaking spaces; normalise case only where it is clearly a category.
  • Numbers: strip currency symbols and thousands separators, convert text numbers, and keep negatives in parentheses as negatives. Do not change precision.
  • Dates: convert to ISO 8601 (YYYY-MM-DD). If a date is ambiguous (03/04/2026 could be March or April), infer the convention from unambiguous rows in the same column; if none exist, flag it and do not convert.
  • Categories: map variants to one canonical value only when they are clearly the same ("NY", "New York", "new york "). Show the mapping. Do not merge values that might be different ("Acme Inc" and "Acme Holdings").
  • Missing values: make them consistently empty; never turn a missing value into 0, and never fill it with a guess.
  1. Duplicates: remove exact duplicate rows only when the table has a record key (an order, invoice or transaction id) that repeats, or when the rows are clearly an export artefact (for example the whole block repeats). Without a key, two identical rows can be two real transactions, so keep them and list them under Needs your decision. Also list likely duplicates (same key, differing values) for the user to decide.
  2. Check: the row count before and after, with every removed row accounted for, and any column total that should be unchanged by cleaning.
constraints
  • Never invent, impute or correct a value from outside knowledge (for example fixing a postcode or a customer's name). Flag it instead.
  • Never silently drop rows. Every removed row appears in the change log with its reason.
  • If the table is longer than you can return in full, clean it all but return the first 50 rows of cleaned data plus the complete change log, and give the rules as steps the user can apply (spreadsheet steps or a short script) for the rest.
  • If the data is not tabular or is too fragmentary to infer columns, say so and ask for a better export.
output format

Issues found

A table: column | issue | rows affected | action.

Cleaned data

The cleaned table as CSV in a code block.

Change log

Numbered, in the order applied. Each: what changed, which rows or values, and the rule used. Include the before and after row counts.

Needs your decision

Bullets for ambiguous dates, likely duplicates, uncertain category merges and suspect values, each with the options. Write "None" if there are none.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Data analysis
category
Spreadsheets
level
Beginner
made for
Data analyst, Business analyst, Operations, Anyone, personal use
risk
read-only
version
v1.1.0 · incubating
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md, ChatGPT, claude.ai

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install clean-messy-spreadsheet --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill clean-messy-spreadsheet -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the data-analysis plugin
claude plugin install hodios-data-analysis@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Spreadsheets
PromptData exploration

Explore a dataset

Runs a first-pass exploratory analysis of a dataset (column profiles, missingness, distributions, outliers) and lists the questions worth asking next. Use when you get new data.

explore-dataset
PromptSpreadsheets

Build a pivot analysis

Designs a pivot table that answers one specific business question and gives exact click-by-click setup steps for Excel or Google Sheets. Use when you have a flat table and a question about it.

build-pivot-analysis
PromptSpreadsheets

Extract tables from a PDF

Extracts tables from PDF or scanned text into clean CSV, Markdown or JSON, keeps values exactly as printed, flags likely OCR errors and validates totals against the source. Use before analysis.

extract-tables-from-pdf
PromptSpreadsheets

Run a what-if analysis

Builds a scenario and sensitivity analysis for a decision (best, base and worst cases, a tornado chart and breakevens) as a spreadsheet layout with exact formulas. Use before committing to a plan.

run-what-if-analysis
PromptSpreadsheets

Audit a spreadsheet model

Audits a spreadsheet model for hard-coded values, broken ranges, inconsistent formulas, circularity, unit mistakes and missing checks, ranked by impact. Use before relying on someone else's sheet.

audit-spreadsheet-model
PromptSpreadsheets

Build a spreadsheet dashboard

Builds a working dashboard inside Excel or Google Sheets with a data tab, summary formulas, charts, slicers or dropdowns and refresh steps. Use when the team lives in spreadsheets, not a BI tool.

build-sheets-dashboard