---
name: xlsx-skill
description: "Create, read, and edit Excel spreadsheets (.xlsx, .xlsm, .csv) — formulas, charts, formatting included. Anthropic's official spreadsheet handler. Opens existing .xlsx/.xlsm/.csv files, adds columns, computes formulas, applies formatting, creates charts, cleans messy data, and converts between tabular formats."
license: MIT
---

# XLSX Skill

Anthropic's official spreadsheet handler for Claude. It opens, builds, and edits Excel and CSV files — `.xlsx`, `.xlsm`, `.csv`, and `.tsv` — preserving formulas, formatting, and charts rather than flattening everything to plain values. It's aimed at anyone who hands Claude a real workbook and expects a real workbook back: analysts cleaning exports, ops folks maintaining trackers, and developers generating reports as part of a pipeline.

## When to use it

- You have a messy export (misplaced headers, blank rows, mixed types) and want a clean, properly typed sheet.
- You need to add a computed column, a SUMIFS, or a pivot-style summary to an existing model without breaking its formulas.
- You want to turn a CSV into a formatted `.xlsx` with frozen headers, number formats, and a chart.
- You're converting between tabular formats (CSV ↔ XLSX, sheet → TSV).
- You need to read values out of a workbook to summarize or feed elsewhere.

## How it works

Under the hood the skill drives the Python **openpyxl** library for cell-level work — styles, fonts, fills, `number_format`, merged cells, frozen panes, conditional formatting, and native chart objects (`BarChart`, `LineChart`, `PieChart`) added via `ws.add_chart()`. For bulk data wrangling it reaches for **pandas** (`read_excel`, `read_csv`, `to_excel`).

The important detail: openpyxl writes formula *strings* but does not compute them. So when a deliverable depends on formula results, the skill recalculates the workbook headlessly (LibreOffice in `--headless` mode) so saved values match the formulas. It inspects existing files before editing so it doesn't clobber sheets it wasn't asked to touch.

## Usage example

```
curl -fsSL --create-dirs -o ~/.claude/skills/xlsx-skill/SKILL.md https://claudeskil.com/skills/xlsx-skill/SKILL.md

# then, in Claude:
"Open ~/Downloads/q2_sales.xlsx, add a 'Margin %' column =
 (Revenue-Cost)/Revenue formatted as a percentage, add a bar chart
 of revenue by region on a new sheet, and freeze the header row."
```

Claude loads the skill, edits with openpyxl, recalculates, and writes the file back (or to a new path you specify).

## Tips & gotchas

- **Formulas need recalculation.** A freshly written `=SUM(...)` shows the formula until the workbook is recalculated. If you read a value-only copy without recalc, you'll get `None` for formula cells.
- **`.xlsm` macros are preserved** when you keep the macro-enabled format, but openpyxl won't author or run VBA — it round-trips existing macros.
- **CSVs carry no formatting or types.** Datatypes are inferred on read; specify expected types when precision matters (e.g. ZIP codes that shouldn't become integers).
- **Large workbooks**: prefer pandas for data-heavy transforms and openpyxl for styling, rather than looping cells in Python.

## FAQ

**Does it keep my existing charts and styles?** Yes — it edits in place through openpyxl, so untouched sheets, styles, and charts survive the round-trip.

**Can it output a Word doc or Google Sheet instead?** No. The deliverable is always a spreadsheet file. Use the docx skill for Word; Google Sheets needs the Sheets API, not this skill.

**Will SUMIFS and VLOOKUP results be correct in the saved file?** Yes, after the headless recalculation pass that the skill runs before saving.
