clean-data-xls — Claude Code skill: spreadsheet data cleanup
Automates cleanup of messy Excel and Google Sheets data: trims whitespace, unifies case, converts numbers stored as text, standardizes dates, removes duplicates, and flags mixed-type columns.
npx skills add anthropics/financial-services --skill clean-data-xls -a claude-codeWhat clean-data-xls does
clean-data-xls profiles each column and detects common problems — leading and double spaces, inconsistent casing in categorical data, numbers stored as text with stray $ or , characters, dates in mixed formats, exact duplicates and near-duplicates, blank cells, mojibake, and errors like #REF!.
The skill proposes fixes in a summary table (Issue, Count, Proposed Fix), then applies them step by step. It prioritizes formulas in adjacent columns (=TRIM(), =UPPER(), =DATEVALUE()) over hardcoded values to keep transformations auditable. Destructive operations (deduplication, in-place overwrite) require confirmation.
In Excel, it runs via Office JS with range.values and range.formulas. On standalone .xlsx files, it uses openpyxl. The skill processes each stage (whitespace → casing → number conversion → dates → dedup), shows samples of changes, and asks for confirmation before moving forward.
What it helps with
- remove leading and trailing whitespace from text columns
- standardize thousands of case variants (USA, usa, Usa) to one format
- convert numbers stored as text with currency symbols back to numbers
- detect and unify dates written in different formats within one column
- remove exact duplicate rows and near-duplicates from typos
Example prompts for the agent
- clean-data-xls: clean up this spreadsheet
- normalize columns A through F — there's whitespace everywhere and inconsistent case
- deduplicate the rows and convert all dates to the same format
How to install clean-data-xls
1Skills CLI (Vercel)
npx skills add anthropics/financial-services --skill clean-data-xls -a claude-code2Manually: put the files in place
~/.claude/skills/clean-data-xls/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/clean-data-xls/
1Skills CLI (Vercel)
npx skills add anthropics/financial-services --skill clean-data-xls -a codex2Manually: put the files in place
.agents/skills/clean-data-xls/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add anthropics/financial-services --skill clean-data-xls -a cursor2Manually: put the files in place
.cursor/skills/clean-data-xls/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install anthropics/financial-services clean-data-xls2Manually: put the files in place
.github/skills/clean-data-xls/SKILL.md1Skills CLI (Vercel)
npx skills add anthropics/financial-services --skill clean-data-xls -a gemini-cli2Platform CLI
gemini skills install https://github.com/anthropics/financial-services --path plugins/vertical-plugins/financial-analysis/skills/clean-data-xlsManually: put the files in place
.devin/skills/clean-data-xls/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add anthropics/financial-services --skill clean-data-xls -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set25
The whole set →Similar
Questions about clean-data-xls
How do I install clean-data-xls for Claude Code?
Run npx skills add anthropics/financial-services --skill clean-data-xls -a claude-code, then check SKILL.md in ~/.claude/skills/clean-data-xls/.
What does clean-data-xls do?
The skill identifies and fixes common spreadsheet errors: whitespace, inconsistent case, numbers in text format, mixed date formats, duplicate rows, and mixed-type columns.
Does it overwrite my original data?
By default, no — it creates formulas in helper columns to preserve the original and keep changes auditable. In-place overwrite requires your confirmation.
Source text
SKILL.md · Apache-2.0
---
name: clean-data-xls
description: Clean up messy spreadsheet data — trim whitespace, fix inconsistent casing, convert numbers-stored-as-text, standardize dates, remove duplicates, and flag mixed-type columns. Use when data is messy, inconsistent, or needs prep before analysis. Triggers on "clean this data", "clean up this sheet", "normalize this data", "fix formatting", "dedupe", "standardize this column", "this data is messy".
---
# Clean Data
Clean messy data in the active sheet or a specified range.
## Environment
- **If running inside Excel (Office Add-in / Office JS):** Use Office JS directly (`Excel.run(async (context) => {...})`). Read via `range.values`, write helper-column formulas via `range.formulas = [["=TRIM(A2)"]]`. The in-place vs helper-column decision still applies.
- **If operating on a standalone .xlsx file:** Use Python/openpyxl.
## Workflow
### Step 1: Scope
- If a range is given (e.g. `A1:F200`), use it
- Otherwise use the full used range of the active sheet
- Profile each column: detect its dominant type (text / number / date) and identify outliers
### Step 2: Detect issues
| Issue | What to look for |
|---|---|
| Whitespace | leading/trailing spaces, double spaces |
| Casing | inconsistent casing in categorical columns (`usa` / `USA` / `Usa`) |
| Number-as-text | numeric values stored as text; stray `$`, `,`, `%` in number cells |
| Dates | mixed formats in the same column (`3/8/26`, `2026-03-08`, `March 8 2026`) |
| Duplicates | exact-duplicate rows and near-duplicates (case/whitespace differences) |
| Blanks | empty cells in otherwise-populated columns |
| Mixed types | a column that's 98% numbers but has 3 text entries |
| Encoding | mojibake (`é`, `’`), non-printing characters |
| Errors | `#REF!`, `#N/A`, `#VALUE!`, `#DIV/0!` |
### Step 3: Propose fixes
Show a summary table before changing anything:
| Column | Issue | Count | Proposed Fix |
|---|---|---|---|
### Step 4: Apply
- **Prefer formulas over hardcoded cleaned values** — where the cleaned output can be expressed as a formula (e.g. `=TRIM(A2)`, `=VALUE(SUBSTITUTE(B2,"$",""))`, `=UPPER(C2)`, `=DATEVALUE(D2)`), write the formula in an adjacent helper column rather than computing the result in Python and overwriting the original. This keeps the transformation transparent and auditable.
- Only overwrite in place with computed values when the user explicitly asks for it, or when no sensible formula equivalent exists (e.g. encoding/mojibake repair)
- For destructive operations (removing duplicates, filling blanks, overwriting originals), confirm with the user first
- After each category of fix (whitespace → casing → number conversion → dates → dedup), show the user a sample of what changed and get confirmation before moving to the next category
- Report a before/after summary of what changed
© anthropics · Apache-2.0 · anthropics/financial-services