xlsx

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

Updated Aug 25, 2017
One-click install
npx skills add https://github.com/loki495/dotfiles --skill xlsx-loki495
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: xlsx
Source: https://github.com/loki495/dotfiles/tree/main/ai/skills/synced/4f2cd280-c105-47f5-b498-fb931ff17906_01354434-3473-483d-87d9-0aa269eff282/xlsx
Command: npx skills add https://github.com/loki495/dotfiles --skill xlsx-loki495

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 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 spreadsheet files that actually recalculate correctly and follow professional formatting 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: Run scripts/recalc.py to evaluate every formula through LibreOffice, returning a JSON report of error cells (#VALUE!, #REF!, #NAME?, and more) so nothing ships broken. - Financial modeling conventions: Apply standard color coding (blue inputs, black formulas, green cross-sheet links), number formats, and assumption documentation for professional models. - Use Case: A user asks to build a revenue projection workbook from raw CSV data. The Skill writes SUMIFS and INDEX/MATCH formulas, recalculates the file in place, fixes any reported errors, and delivers a workbook whose values update when inputs change. ## Quick Start Ask the AI to create or edit a spreadsheet file, for example: "Build an xlsx budget tracker from my expenses.csv with monthly totals computed by formulas."

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 readable by 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 read-only look at a sheet, the markitdown command renders each sheet without cell coordinates.

Why do openpyxl formulas show 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. Running a LibreOffice-based recalculation pass computes every formula and rewrites the file in place with 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), 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. The same caution applies to workbooks with external file links, whose cached values openpyxl removes when re-saving.

Why does recalculation refuse to run on my workbook?▼

Recalculation is refused when the workbook links to another file and linked cells have lost their cached values, because resolving them would produce #NAME? errors and delete the links. Copy the values from the original file first, or use --force to accept the loss.