xlsx

Create, edit, and recalculate Excel spreadsheets using openpyxl, pandas, and LibreOffice.

Updated Sep 1, 2026
One-click install
npx skills add https://github.com/sshekhar-04/SIH_PS_26151 --skill xlsx-sshekhar-04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/sshekhar-04/SIH_PS_26151/tree/main/.agents/Skills/xlsx
Command: npx skills add https://github.com/sshekhar-04/SIH_PS_26151 --skill xlsx-sshekhar-04

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Spreadsheet tasks often fail silently: formulas written by scripts never get calculated, modern Excel functions break in other runtimes, and edited files lose their formatting or external links. This Skill provides a disciplined workflow for producing spreadsheet files that actually recalculate, contain zero formula errors, and follow professional financial-modeling conventions. ## Core Features & Use Cases - Spreadsheet creation and editing: Build or modify .xlsx, .xlsm, .xltx, .csv, and .tsv files with openpyxl for formulas and formatting, or pandas for bulk data movement. - Mandatory formula recalculation: The bundled recalc.py script drives LibreOffice headlessly to compute every formula, then reports JSON with error counts and exact cell locations for #VALUE!, #REF!, #NAME?, and other failures. - Data cleaning and conversion: Restructure messy tabular data (malformed rows, misplaced headers) into proper spreadsheets, and convert between tabular formats. - Use Case: A user asks to build a revenue forecast workbook. The Skill writes SUMIFS and INDEX/MATCH formulas (avoiding unsupported functions like XLOOKUP), applies blue-input/black-formula color conventions, runs recalc.py until zero errors remain, and delivers a workbook that recalculates when inputs change. ## Quick Start Use the xlsx skill to create a quarterly budget spreadsheet with formulas for totals and then verify it has 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 write formula strings directly into cells, such as sheet['B10'] = '=SUM(B2:B9)'. Because openpyxl stores no cached values, run the recalc.py script with LibreOffice afterward so the formulas compute and the file reads correctly in pandas and previewers.

openpyxl vs pandas for Excel files: which should I use?

Use openpyxl when you need formulas, formatting, charts, or cell-level edits; use pandas read_excel and to_excel for bulk data movement in and out of sheets. For a quick look at sheet contents, the markitdown command prints each sheet without cell coordinates.

Why do my openpyxl formulas show as None when read back?

openpyxl writes formulas as strings with no cached values, so data_only=True reads return None until the file is recalculated. Run scripts/recalc.py, which uses LibreOffice to compute every formula and rewrite the file in place.

Which Excel functions work with LibreOffice recalculation?

Excel-2007-era functions like SUMIFS, INDEX, MATCH, IFERROR, and SUMPRODUCT work directly. Six newer functions need an _xlfn. prefix (TEXTJOIN, CONCAT, IFS, SWITCH, MAXIFS, MINIFS). XLOOKUP, XMATCH, SORT, FILTER, UNIQUE, and SEQUENCE must be avoided entirely.

Does editing an .xlsm file keep its macros?

Macros are preserved only if you pass keep_vba=True to openpyxl's load_workbook. Without that flag, saving the workbook strips the VBA project permanently.

Why does recalc.py refuse to run on my workbook?

recalc.py refuses when the workbook links to another file and those linked cells have lost their cached values, because recalculating would resolve them to #NAME? and delete the links. Copy the values from the original file first, or pass --force to accept the loss.