xlsx
v0.1.0Comprehensive spreadsheet creation, editing, and analysis with support for formulas, 格式化ting, data analysis, and 可视化. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and 格式化ting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and 可视化 in spreadsheets, or (5) Recalculating formulas
运行时依赖
安装命令
点击复制技能文档
Requirements for 输出s All Excel files Zero Formula Errors Every Excel 模型 MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?) Preserve Existing Templates (when updating templates) Study and EXACTLY match existing 格式化, style, and conventions when modifying files Never impose standardized 格式化ting on files with established patterns Existing template conventions ALWAYS override these 图形界面delines Financial 模型s Color Coding Standards
Unless otherwise 状态d by the user or existing template
Industry-Standard Color Conventions Blue text (RGB: 0,0,255): Hardcoded 输入s, and numbers users will change for scenarios Black text (RGB: 0,0,0): ALL formulas and calculations Green text (RGB: 0,128,0): Links pulling from other worksheets within same workbook Red text (RGB: 255,0,0): External links to other files Yellow background (RGB: 255,255,0): Key assumptions needing attention or cells that need to be 更新d Number 格式化ting Standards Required 格式化 Rules Years: 格式化 as text strings (e.g., "2024" not "2,024") Currency: Use $#,##0 格式化; ALWAYS specify units in headers ("Revenue ($mm)") Zeros: Use number 格式化ting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-") Percentages: Default to 0.0% 格式化 (one decimal) Multiples: 格式化 as 0.0x for valuation multiples (EV/EBITDA, P/E) Negative numbers: Use parentheses (123) not minus -123 Formula Construction Rules Assumptions Placement Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells Use cell references instead of hardcoded values in formulas Example: Use =B5(1+$B$6) instead of =B51.05 Formula Error 预防ion 验证 all cell references are correct 检查 for off-by-one errors in ranges Ensure consistent formulas across all projection periods Test with edge cases (zero values, negative numbers) 验证 no unintended circular references Documentation Requirements for Hardcodes Comment or in cells beside (if end of table). 格式化: "Source: [系统/Document], [Date], [Specific Reference], [URL if 应用licable]" Examples: "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]" "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]" "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity" "Source: Fact设置, 8/20/2025, Consensus Estimates Screen" XLSX creation, editing, and analysis Overview
A user may ask you to 创建, edit, or analyze the contents of an .xlsx file. You have different 工具s and 工作流s avAIlable for different tasks.
导入ant Requirements
LibreOffice Required for Formula Recalculation: You can assume LibreOffice is 安装ed for recalculating formula values using the recalc.py script. The script automatically 配置s LibreOffice on first 运行
Reading and analyzing data Data analysis with pandas
For data analysis, 可视化, and basic operations, use pandas which provides powerful data manipulation capabilities:
导入 pandas as pd
# Read Excel df = pd.read_excel('file.xlsx') # Default: first sheet all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # All sheets as dict
# Analyze df.head() # Preview data df.信息() # Column 信息 df.describe() # Statistics
# Write Excel df.to_excel('输出.xlsx', 索引=False)
Excel File 工作流s CRITICAL: Use Formulas, Not Hardcoded Values
Always use Excel formulas instead of calculating values in Python and hardcoding them. This ensures the spreadsheet remAIns dynamic and 更新able.
❌ WRONG - Hardcoding Calculated Values # Bad: Calculating in Python and hardcoding 结果 total = df['Sales'].sum() sheet['B10'] = total # Hardcodes 5000
# Bad: Computing growth rate in Python growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue'] sheet['C5'] = growth # Hardcodes 0.15
# Bad: Python calculation for average avg = sum(values) / len(values) sheet['D20'] = avg # Hardcodes 42.5
✅ CORRECT - Using Excel Formulas # Good: Let Excel calculate the sum sheet['B10'] = '=SUM(B2:B9)'
# Good: Growth rate as Excel formula sheet['C5'] = '=(C4-C2)/C2'
# Good: Average using Excel function sheet['D20'] = '=AVERAGE(D2:D19)'
This 应用lies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.
Common 工作流 Choose 工具: pandas for data, openpyxl for formulas/格式化ting 创建/Load: 创建 new workbook or load existing file Modify: 添加/edit data, formulas, and 格式化ting Save: Write to file Recalculate formulas (MANDATORY IF USING FORMULAS): Use the recalc.py script python recalc.py 输出.xlsx
验证 and fix any errors: The script returns JSON with error detAIls If 状态 is errors_found, 检查 error_summary for specific error types and locations Fix the identified errors and recalculate agAIn Common errors to fix: #REF!: Invalid cell references #DIV/0!: Division by zero #VALUE!: Wrong data type in formula #NAME?: Unrecognized formula name Creating new Excel files