xlsx

Create, edit, and analyze Excel spreadsheets with formulas, formatting, and recalculation.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/pchemguy/AISandbox --skill xlsx-pchemguy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/pchemguy/AISandbox/tree/main/docs/AgentSkills/anthropics/skills/skills/xlsx
Command: npx skills add https://github.com/pchemguy/AISandbox --skill xlsx-pchemguy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openpyxl, pandas, and includes scripts (resource) components.

What problem does it solve? Working with spreadsheets programmatically often leads to hardcoded values, broken formulas, and undetected errors like #REF! or #DIV/0!. This Skill provides a structured workflow for building and modifying Excel files that remain dynamic, correctly formatted, and error-free. ## Core Features & Use Cases - Spreadsheet Creation & Editing: Build new .xlsx files or modify existing ones using openpyxl while preserving formulas and formatting, with pandas support for data analysis. - Formula Recalculation & Error Detection: Run the included recalc.py script with LibreOffice to recalculate all formulas and scan every cell for Excel errors, returning JSON with exact error locations. - Financial Modeling Standards: Apply industry-standard color coding (blue inputs, black formulas, green cross-sheet links), number formatting, and assumption-cell conventions for professional financial models. - Use Case: Build a revenue projection model where growth rates live in assumption cells, all totals use Excel formulas, and recalc.py verifies zero formula errors before delivery. ## Quick Start Ask the AI to create an Excel financial model with formulas for revenue projections and then recalculate and verify it contains no formula errors.

Frequently Asked Questions about xlsx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an Excel file with formulas in Python?▼

Use openpyxl to create a workbook and assign formula strings like '=SUM(B2:B9)' directly to cells, then save with wb.save(). Always run recalc.py afterward so LibreOffice calculates the formula values, since openpyxl stores formulas without evaluating them.

Should I use pandas or openpyxl for Excel files?▼

Use pandas for data analysis, bulk operations, and simple exports via read_excel and to_excel. Use openpyxl when you need formulas, cell formatting, multiple sheets, or editing existing files while preserving their structure.

How do I recalculate Excel formulas after editing with openpyxl?▼

Run 'python recalc.py output.xlsx' from the command line. The script configures a LibreOffice macro on first run, recalculates all formulas in all sheets, and returns JSON reporting any Excel errors with their exact cell locations.

Why does my Excel file show #REF! or #DIV/0! errors?▼

#REF! occurs when formulas point to invalid cell references, and #DIV/0! happens when dividing by zero or empty cells. Run recalc.py to get a JSON error summary listing each error type with up to 20 cell locations, then fix the references and recalculate again.

Does openpyxl preserve formulas when editing existing spreadsheets?▼

Yes, loading with load_workbook() preserves formulas and formatting by default. However, opening with data_only=True and saving replaces formulas with their cached values permanently, so only use data_only for reading calculated values.