# XLSX Manipulation

Create, edit, and manipulate Excel spreadsheets programmatically using openpyxl

- Repository: https://github.com/claude-office-skills/skills (556 stars)
- Category: Documents
- License: MIT
- Last updated: 2026-01-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add claude-office-skills/skills --skill xlsx-manipulation -g -a claude-code -y`
Codex: `npx skills add claude-office-skills/skills --skill xlsx-manipulation -g -a codex -y`
Cursor: `npx skills add claude-office-skills/skills --skill xlsx-manipulation -g -a cursor -y`
Gemini CLI: `npx skills add claude-office-skills/skills --skill xlsx-manipulation -g -a gemini-cli -y`

## Description

Create, edit, and manipulate Excel spreadsheets programmatically using openpyxl

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# XLSX Manipulation Skill

## Overview

This skill enables programmatic creation, editing, and manipulation of Microsoft Excel (.xlsx) spreadsheets using the **openpyxl** library. Create professional spreadsheets with formulas, formatting, charts, and data validation without manual editing.

## How to Use

1. Describe the spreadsheet you want to create or modify
2. Provide data, formulas, or formatting requirements
3. I'll generate openpyxl code and execute it

**Example prompts:**
- "Create a budget spreadsheet with monthly tracking"
- "Add conditional formatting to highlight values above threshold"
- "Generate a pivot-table-like summary from this data"
- "Create a dashboard with charts and KPIs"

## Domain Knowledge

### openpyxl Fundamentals

```python
from openpyxl import Workbook, load_workbook
from openpyxl.styles import Font, Fill, Border, Alignment
from openpyxl.chart import BarChart, Reference

# Create new workbook
wb = Workbook()
ws = wb.active

# Or open existing
wb = load_workbook('existing.xlsx')
ws = wb.active
```

### Workbook Structure
```
Workbook
├── worksheets (sheets/tabs)
│   ├── cells (data storage)
│   ├── rows/columns (formatting)
│   ├── merged_cells
│   └── charts
├── defined_names (named ranges)
└── styles (formatting templates)
```

### Working with Cells

#### Basic Cell Operations
```python
# By cell reference
ws['A1'] = 'Header'
ws['B1'] = 42

# By row, column
ws.cell(row=1, column=3, value='Data')

# Multiple cells
ws['A1:C1'] = [['Col1', 'Col2', 'Col3']]

# Append rows
ws.append(['Row', 'Data', 'Here'])
```

#### Reading Cells
```python
# Single cell
value = ws['A1'].value

# Cell range
for row in ws['A1:C3']:
    for cell in row:
        print(cell.value)

# Iterate rows
for row in ws.iter_rows(min_row=1, max_row=10, min_col=1, max_col=3):
    for cell in row:
        print(cell.value)
```

### Formulas
```python
# Basic formulas
ws['D1'] = '=SUM(A1:C1)'
ws['D2'] = '=AVERAGE(A2:C2)'
ws['E1'] = '=IF(D1>100,"High","Low")'

The rest: https://github.com/claude-office-skills/skills/blob/HEAD/xlsx-manipulation/SKILL.md
