xlsx

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

6|1|Updated Sep 3, 2026
One-click install
npx skills add https://github.com/jasonzhu0922-sketch/agentloop --skill xlsx-jasonzhu0922-sketch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/jasonzhu0922-sketch/agentloop/tree/main/packages/agentloop-skills/skills/xlsx
Command: npx skills add https://github.com/jasonzhu0922-sketch/agentloop --skill xlsx-jasonzhu0922-sketch

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 have no cached values, unsupported functions turn into #NAME? errors, and external links get destroyed on save. This Skill provides a disciplined workflow for producing spreadsheet files that actually recalculate correctly and follow professional formatting conventions. ## Core Features & Use Cases - Create and edit workbooks: Use openpyxl for formulas and formatting, pandas for bulk data in and out, and markitdown for quick sheet previews across .xlsx, .xlsm, .xltx, .csv, and .tsv files. - 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. - Financial modeling conventions: Built-in guidance for color coding inputs versus formulas, number formats, assumption documentation, and formula choices that survive LibreOffice verification. - Use Case: A user asks to build a revenue forecast workbook from raw CSV data. The Skill writes SUMIFS and INDEX/MATCH formulas with openpyxl, recalculates with recalc.py, fixes any reported errors, and delivers a workbook whose formulas evaluate cleanly. ## Quick Start Use the xlsx skill to create a formatted budget spreadsheet from my expenses.csv with working SUM formulas and 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 formulas as strings, such as sheet['B10'] = '=SUM(B2:B9)', rather than hardcoding 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 you need formulas, formatting, or cell-level edits; use pandas read_excel and to_excel for bulk data movement. 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 script 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 without prefixes. Six newer functions need an _xlfn. prefix, 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. Also note that saving with data_only=True permanently replaces every formula with its literal value.

Why does recalculation fail on workbooks with external links?

openpyxl strips cached values from cells referencing other files, so LibreOffice resolves them to #NAME? and deletes the links. Copy those cell values from the original before saving, or use --force to accept the loss.