---
name: excel-spreadsheet-wizard
description: "Build .xlsx files: formulas, conditional formatting, pivot tables, charts — typed and tested. Generates Excel spreadsheets with working formulas (no #REF! errors), conditional formatting, pivots, named ranges, and chart data. Compatible with Excel, Google Sheets, and Numbers."
license: MIT
---

# Excel Spreadsheet Wizard

Excel Spreadsheet Wizard builds real `.xlsx` workbooks programmatically — with formulas that calculate, conditional formatting that triggers, named ranges that resolve, and chart-ready data layouts. It is aimed at developers and analysts who need to hand off a finished spreadsheet (a budget model, a KPI report, a reconciliation sheet) rather than a CSV dump, and who are tired of debugging `#REF!` and `#NAME?` errors after the fact.

## When to use it

- You need a recurring report (monthly close, cohort retention, commission run) emitted as a styled workbook.
- You're turning a query result or JSON payload into a deliverable with subtotals, a pivot summary, and a chart.
- You want a financial model where downstream cells recalculate when inputs change — not pre-computed static values.
- You need output that opens cleanly in Excel, Google Sheets, and Numbers without "repair" prompts.

## How it works

Under the hood the skill writes workbooks with the OpenPyXL engine and validates them before returning. Key capabilities:

- **Formulas** written as strings into cells (`ws["D2"] = "=SUM(B2:C2)"`), with relative/absolute references resolved against the actual data range so they don't drift or break.
- **Conditional formatting** via `ColorScaleRule`, `CellIsRule`, and `FormulaRule` (data bars, color scales, highlight-greater-than, etc.).
- **Named ranges** registered through `DefinedName` so formulas read `=SUM(Revenue)` instead of opaque coordinates.
- **Charts** (`BarChart`, `LineChart`, `PieChart`) wired to `Reference` ranges.
- **Pivot-style summaries** generated as grouped/aggregated sheets (true native pivot caches are limited in the `.xlsx` spec, so the skill emits a refreshable summary table plus the source range).

After generation it loads the file back, recalculates with a formula evaluator, and flags any cell resolving to an error before you ship it.

## Usage

```
curl -fsSL --create-dirs -o ~/.claude/skills/excel-spreadsheet-wizard/SKILL.md https://claudeskil.com/skills/excel-spreadsheet-wizard/SKILL.md

# then, in a session:
> Build sales_report.xlsx from this CSV. Add a "Total" column
> (=quantity*unit_price), a color scale on the Total column,
> a named range "Revenue" over it, and a bar chart of revenue
> by region on a second sheet.
```

You can also point it at existing data: "open Q3.xlsx, add a conditional-format rule flagging margins below 20% in red, and a summary pivot by product line."

## Tips & gotchas

- **Formulas are stored, not evaluated by the writer.** Excel/Sheets computes them on open; the skill's validator pre-checks them, but a blank cell on first open usually means the app hasn't recalculated — press F9 or enable auto-calc.
- **Cross-sheet references need quoted sheet names** when they contain spaces: `='Raw Data'!A2`. Ask the skill to handle quoting and it will.
- **Numbers is the strictest reader.** Exotic conditional-format icon sets may degrade there; stick to color scales and data bars for full cross-app fidelity.
- **Pivots aren't live pivot tables** — they're aggregated summary sheets. If you need a refreshable native PivotTable, say so and keep the source range intact.

## FAQ

**Will it overwrite my existing workbook?** No — it writes to a new path unless you explicitly ask it to edit a file in place.

**Can it preserve my existing styles and macros?** Cell styles and data are preserved on edits. VBA macros require `.xlsm`; tell it to keep macros and it will use the macro-enabled format.

**Does it support multiple sheets and formulas across them?** Yes — multi-sheet workbooks with inter-sheet formulas and named ranges spanning sheets are fully supported.
