xlsx

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

Updated Sep 21, 2026
Ready to run
npx skills add https://github.com/tangyixiao/tangyixiao-skills --skill xlsx-tangyixiao
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/tangyixiao/tangyixiao-skills/tree/main/xlsx
Command: npx skills add https://github.com/tangyixiao/tangyixiao-skills --skill xlsx-tangyixiao

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 openpyxl have no cached values, unsupported functions become #NAME? errors, and external workbook links get destroyed on save. This Skill provides a disciplined workflow for producing Excel files whose formulas actually evaluate and whose numbers are correct. ## Core Features & Use Cases - Spreadsheet creation and editing: Build or modify .xlsx, .xlsm, .xltx, .csv, and .tsv files with openpyxl and pandas, following financial-modeling conventions for colors, number formats, and structure. - Mandatory formula recalculation: Run scripts/recalc.py to recalculate every formula via LibreOffice, returning JSON with error counts and cell locations for #VALUE!, #REF!, #NAME?, and other Excel errors. - External-link protection: Detects formulas referencing other workbooks that would lose their cached values, and refuses to recalculate unless forced. - Use Case: A user asks for a three-year revenue projection model. The Skill writes SUMIFS and INDEX/MATCH formulas, applies blue-input/black-formula coloring, recalculates the workbook, fixes any reported errors, and delivers a file that recomputes when inputs change. ## Quick Start Use the xlsx skill to add a totals row with SUM formulas to my sales-report.xlsx and verify the file 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 like sheet['B10'] = '=SUM(B2:B9)' rather than Python-computed values. After saving, recalculate the file with LibreOffice so formula cells contain cached values that pandas and previewers can read.

openpyxl vs pandas for Excel files, which should I use?▼

Use openpyxl when creating or editing files with formulas, formatting, or charts. Use pandas read_excel and to_excel for bulk data movement in and out of spreadsheets. For a quick look at sheet contents, markitdown renders each sheet without cell coordinates.

Why do openpyxl formulas show None when I read the file back?▼

openpyxl writes formulas as strings with no cached values, so data_only=True returns None until the file is recalculated. Run a LibreOffice-based recalculation pass, which rewrites the file in place with computed values.

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.

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. The same recalculation workflow applies afterward to refresh formula values.

Why does recalculation refuse to run on my workbook?▼

The workbook links to another file and some linked cells have lost their cached values, which openpyxl strips on save. Recalculating would resolve them to #NAME? and delete the links, so copy the values from the original first or use --force to accept the loss.