xlsx

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

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill xlsx-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/agents/.agents/skills/xlsx
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill xlsx-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Spreadsheet tasks often fail silently: formulas written by scripts never recalculate, modern Excel functions break in LibreOffice, and external workbook links get destroyed on save. This Skill provides a disciplined workflow for producing spreadsheet files that actually evaluate correctly, with zero formula errors and professional formatting. ## Core Features & Use Cases - Spreadsheet creation and editing: Build or modify .xlsx, .xlsm, .xltx, .csv, and .tsv files using openpyxl for formulas/formatting and pandas for bulk data movement. - Mandatory formula recalculation: The bundled recalc.py script runs LibreOffice headlessly to compute every formula, then reports a JSON summary of any #VALUE!, #REF!, #NAME?, or other errors with exact cell locations. - Financial modeling conventions: Built-in guidance for color coding (blue inputs, black formulas, green cross-sheet links), number formats, and assumption documentation. - Use Case: A user asks to build a revenue projection model from raw CSV data. The Skill writes formulas with openpyxl, recalculates with LibreOffice, fixes any reported errors, and delivers a workbook that recalculates live when inputs change. ## Quick Start Ask the assistant to create an Excel workbook from your data with live formulas, for example: build a financial model spreadsheet from this CSV with SUMIFS rollups and 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 a LibreOffice-based recalculation afterward so the formulas evaluate and readers see actual results.

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. The two libraries complement each other rather than compete.

Why do my openpyxl formulas read back as None?

openpyxl writes formulas as strings with no cached values, so data_only=True returns None until the file is recalculated. Recalculate the workbook with LibreOffice first, then cached values become readable.

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), while XLOOKUP, XMATCH, SORT, FILTER, UNIQUE, and SEQUENCE must be avoided entirely.

Can openpyxl edit .xlsm files without losing macros?

Yes, but you must pass keep_vba=True to load_workbook, otherwise the macros are stripped on save. After editing, recalculation still works because LibreOffice reads .xlsm files.

Why does recalculation refuse to run on my workbook?

The recalc script refuses when the workbook links to another file and those linked cells have lost 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.