Xlsx Spreadsheet Processing
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md and install @org-02qudk26/cn-xlsx
About this skill
Problem
Excel delivery often fails in two ways: calculations are hardcoded after being computed in Python, so the workbook stops updating when source data changes; and formula references, cross-sheet links, number formats, and recalculation errors are not checked as one pipeline, letting #REF!, #DIV/0!, and #VALUE! surface late.
This skill turns .xlsx creation, editing, and analysis into a reproducible engineering workflow.
How It Works
- Data analysis: use
pandasto read, filter, and aggregate workbook data for batch cleaning and quick exploration. - Formulas and formatting: use
openpyxlto write Excel formulas, styles, and cross-sheet references instead of static hardcoded values. - Template first: when updating an existing file, preserve the existing font, color, number format, and model conventions before imposing a generic standard.
- Automatic recalculation: run
scripts/recalc.pywith LibreOffice to recalculate formulas and scan every worksheet for errors, returning error types and locations. - Repair loop: use the error summary to fix invalid references, division by zero,
#NAME?, and type mismatches, then revalidate until the result is stable.
Boundaries and Notes
Use this for financial models, operating analysis, working papers, and maintainable .xlsx deliverables; it is heavier than a one-time static export. Be careful that openpyxl with data_only=True can read calculated values and permanently replace formulas. For large files, prefer read_only or write_only. Cross-sheet references should be checked for Sheet1!A1 syntax, column mapping, and 1-based indexing.
Use Cases
- Update a financial model while preserving existing colors and formats and move growth-rate assumptions into separate cells.
- Read multiple Excel sheets with pandas, validate column mapping and null values, then write a summary worksheet.
- After changing openpyxl formulas, recalculate with LibreOffice and locate #REF! or #DIV/0! errors.
- Before delivering an operating analysis workbook, check cross-sheet references, bracketed negatives, and zero display.
Best For
- Financial modeling analysts who need zero formula errors, consistent color coding, and traceable hardcoded sources.
- Operations or data specialists who need pandas-based multi-sheet cleaning and updateable summary workbooks.
- Engineering staff maintaining Excel templates who need openpyxl formula and style edits without breaking conventions.
- Delivery reviewers who need LibreOffice recalculation and workbook-wide error location.
Related Skills
Organizes files by extension into subfolders like Documents, Code, and Archives, then outputs a report.
Extract tables, formulas, charts, and layout from invoices, reports, papers, and multi-column documents.
Generates a multi-sheet Excel report containing only structured data tables from byteplan-analysis results.
Automatically sort directory files into type-based folders, with dry-run preview, reports, and JSON custom rules.