Spreadsheet Skill (Create, Edit, Analyze, Visualize)
When to use
- Build new workbooks with formulas, formatting, and structured layouts.
- Read or analyze tabular data (filter, aggregate, pivot, compute metrics).
- Modify existing workbooks without breaking formulas or references.
- Visualize data with charts/tables and sensible formatting.
IMPORTANT: System and user instructions always take precedence.
Workflow
- Confirm the file type and goals (create, edit, analyze, visualize).
- Use
openpyxl for .xlsx edits and pandas for analysis and CSV/TSV workflows.
- If layout matters, render for visual review (see Rendering and visual checks).
- Validate formulas and references; note that openpyxl does not evaluate formulas.
- Save outputs and clean up intermediate files.
Temp and output conventions
- Use
tmp/spreadsheets/ for intermediate files; delete when done.
- Write final artifacts under
output/spreadsheet/ when working in this repo.
- Keep filenames stable and descriptive.
Primary tooling
- Use
openpyxl for creating/editing .xlsx files and preserving formatting.
- Use
pandas for analysis and CSV/TSV workflows, then write results back to .xlsx or .csv.
- If you need charts, prefer
openpyxl.chart for native Excel charts.
Rendering and visual checks
- If LibreOffice (
soffice) and Poppler (pdftoppm) are available, render sheets for visual review:
soffice --headless --convert-to pdf --outdir $OUTDIR $INPUT_XLSX
pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME
- If rendering tools are unavailable, ask the user to review the output locally for layout accuracy.
Dependencies (install if missing)
Prefer uv for dependency management.
Python packages:
uv pip install openpyxl pandas
If uv is unavailable:
python3 -m pip install openpyxl pandas
Optional (chart-heavy or PDF review workflows):
uv pip install matplotlib
If uv is unavailable:
python3 -m pip install matplotlib
System tools (for rendering):
# macOS (Homebrew)
brew install libreoffice poppler
# Ubuntu/Debian
sudo apt-get install -y libreoffice poppler-utils
If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.
Environment
No required environment variables.
Examples
- Runnable Codex examples (openpyxl):
references/examples/openpyxl/
Formula requirements
- Use formulas for derived values rather than hardcoding results.
- Keep formulas simple and legible; use helper cells for complex logic.
- Avoid volatile functions like INDIRECT and OFFSET unless required.
- Prefer cell references over magic numbers (e.g.,
=H6*(1+$B$3) not =H6*1.04).
- Guard against errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?) with validation and checks.
- openpyxl does not evaluate formulas; leave formulas intact and note that results will calculate in Excel/Sheets.
Citation requirements
- Cite sources inside the spreadsheet using plain text URLs.
- For financial models, cite sources of inputs in cell comments.
- For tabular data sourced from the web, include a Source column with URLs.
Formatting requirements (existing formatted spreadsheets)
- Render and inspect a provided spreadsheet before modifying it when possible.
- Preserve existing formatting and style exactly.
- Match styles for any newly filled cells that were previously blank.
Formatting requirements (new or unstyled spreadsheets)
- Use appropriate number and date formats (dates as dates, currency with symbols, percentages with sensible precision).
- Use a clean visual layout: headers distinct from data, consistent spacing, and readable column widths.
- Avoid borders around every cell; use whitespace and selective borders to structure sections.
- Ensure text does not spill into adjacent cells.
Color conventions (if no style guidance)
- Blue: user input
- Black: formulas/derived values
- Green: linked/imported values
- Gray: static constants
- Orange: review/caution
- Light red: error/flag
- Purple: control/logic
- Teal: visualization anchors (key KPIs or chart drivers)
Finance-specific requirements
- Format zeros as "-".
- Negative numbers should be red and in parentheses.
- Always specify units in headers (e.g., "Revenue ($mm)").
- Cite sources for all raw inputs in cell comments.
Investment banking layouts
If the spreadsheet is an IB-style model (LBO, DCF, 3-statement, valuation):
- Totals should sum the range directly above.
- Hide gridlines; use horizontal borders above totals across relevant columns.
- Section headers should be merged cells with dark fill and white text.
- Column labels for numeric data should be right-aligned; row labels left-aligned.
- Indent submetrics under their parent line items.
1---2title: "🛠️ \"spreadsheet\""3tags: ["skill","content","excel"]4name: spreadsheet-35description: "Use when tasks involve creating, editing, analyzing, or formatting spreadsheets (`.xlsx`, `.csv`, `.tsv`) using Python (`openpyxl`, `pandas`), especially when formulas, references, and formatting need to be preserved and verified."6author: openai7upstream:8 match: fork9 note: upstream removed this file; we own this copy now10 repo: openai/skills11 path: xlsx-processing-openai/SKILL.md12 checked: 2026-08-2613metadata:14 source: https://skillmd.com/skills/michaelschecht/spreadsheet-315---161718# Spreadsheet Skill (Create, Edit, Analyze, Visualize)1920## When to use21- Build new workbooks with formulas, formatting, and structured layouts.22- Read or analyze tabular data (filter, aggregate, pivot, compute metrics).23- Modify existing workbooks without breaking formulas or references.24- Visualize data with charts/tables and sensible formatting.2526IMPORTANT: System and user instructions always take precedence.2728## Workflow291. Confirm the file type and goals (create, edit, analyze, visualize).302. Use `openpyxl` for `.xlsx` edits and `pandas` for analysis and CSV/TSV workflows.313. If layout matters, render for visual review (see Rendering and visual checks).324. Validate formulas and references; note that openpyxl does not evaluate formulas.335. Save outputs and clean up intermediate files.3435## Temp and output conventions36- Use `tmp/spreadsheets/` for intermediate files; delete when done.37- Write final artifacts under `output/spreadsheet/` when working in this repo.38- Keep filenames stable and descriptive.3940## Primary tooling41- Use `openpyxl` for creating/editing `.xlsx` files and preserving formatting.42- Use `pandas` for analysis and CSV/TSV workflows, then write results back to `.xlsx` or `.csv`.43- If you need charts, prefer `openpyxl.chart` for native Excel charts.4445## Rendering and visual checks46- If LibreOffice (`soffice`) and Poppler (`pdftoppm`) are available, render sheets for visual review:47 - `soffice --headless --convert-to pdf --outdir $OUTDIR $INPUT_XLSX`48 - `pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME`49- If rendering tools are unavailable, ask the user to review the output locally for layout accuracy.5051## Dependencies (install if missing)52Prefer `uv` for dependency management.5354Python packages:55```56uv pip install openpyxl pandas57```58If `uv` is unavailable:59```60python3 -m pip install openpyxl pandas61```62Optional (chart-heavy or PDF review workflows):63```64uv pip install matplotlib65```66If `uv` is unavailable:67```68python3 -m pip install matplotlib69```70System tools (for rendering):71```72# macOS (Homebrew)73brew install libreoffice poppler7475# Ubuntu/Debian76sudo apt-get install -y libreoffice poppler-utils77```7879If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.8081## Environment82No required environment variables.8384## Examples85- Runnable Codex examples (openpyxl): `references/examples/openpyxl/`8687## Formula requirements88- Use formulas for derived values rather than hardcoding results.89- Keep formulas simple and legible; use helper cells for complex logic.90- Avoid volatile functions like INDIRECT and OFFSET unless required.91- Prefer cell references over magic numbers (e.g., `=H6*(1+$B$3)` not `=H6*1.04`).92- Guard against errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?) with validation and checks.93- openpyxl does not evaluate formulas; leave formulas intact and note that results will calculate in Excel/Sheets.9495## Citation requirements96- Cite sources inside the spreadsheet using plain text URLs.97- For financial models, cite sources of inputs in cell comments.98- For tabular data sourced from the web, include a Source column with URLs.99100## Formatting requirements (existing formatted spreadsheets)101- Render and inspect a provided spreadsheet before modifying it when possible.102- Preserve existing formatting and style exactly.103- Match styles for any newly filled cells that were previously blank.104105## Formatting requirements (new or unstyled spreadsheets)106- Use appropriate number and date formats (dates as dates, currency with symbols, percentages with sensible precision).107- Use a clean visual layout: headers distinct from data, consistent spacing, and readable column widths.108- Avoid borders around every cell; use whitespace and selective borders to structure sections.109- Ensure text does not spill into adjacent cells.110111## Color conventions (if no style guidance)112- Blue: user input113- Black: formulas/derived values114- Green: linked/imported values115- Gray: static constants116- Orange: review/caution117- Light red: error/flag118- Purple: control/logic119- Teal: visualization anchors (key KPIs or chart drivers)120121## Finance-specific requirements122- Format zeros as "-".123- Negative numbers should be red and in parentheses.124- Always specify units in headers (e.g., "Revenue ($mm)").125- Cite sources for all raw inputs in cell comments.126127## Investment banking layouts128If the spreadsheet is an IB-style model (LBO, DCF, 3-statement, valuation):129- Totals should sum the range directly above.130- Hide gridlines; use horizontal borders above totals across relevant columns.131- Section headers should be merged cells with dark fill and white text.132- Column labels for numeric data should be right-aligned; row labels left-aligned.133- Indent submetrics under their parent line items.