# Generating Spreadsheets

> Creates Excel spreadsheets (.xlsx) with formatted data, formulas, multiple sheets, or embedded charts. Use when the deliverable is a spreadsheet or the user asks for data in Excel.

- Skill: `aaravriyer193/generating-spreadsheets` (Agent Skill)
- Install (CLI): `npx skillmds@latest add aaravriyer193/generating-spreadsheets`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aaravriyer193/generating-spreadsheets/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: aaravriyer193 (https://skillmd.com/u/aaravriyer193)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/aaravriyer193/generating-spreadsheets

---


# Generating spreadsheets

Never hand-write .xlsx — build it with openpyxl.

```bash
pip install openpyxl
```

```python
from openpyxl import Workbook
from openpyxl.styles import Font

wb = Workbook()
ws = wb.active
ws.title = "Data"
ws.append(["Name", "Revenue", "Growth"])
for cell in ws[1]:
    cell.font = Font(bold=True)
ws.append(["Acme", 120000, 0.18])

ws2 = wb.create_sheet("Summary")
ws2["A1"] = "Total"
ws2["B1"] = "=SUM(Data!B2:B1000)"

wb.save("/home/user/data.xlsx")
```

Columns don't auto-size — set widths explicitly if the sheet needs to be readable without manual resizing: `ws.column_dimensions["A"].width = 18`.

Use openpyxl (not pandas.to_excel) whenever the sheet needs formatting, formulas, or multiple styled sheets. pandas is fine only for a plain data dump with no styling need.

