xlsxlisted
Install: claude install-skill Everfern-AI/Everfern
# XLSX Creation, Editing, and Analysis in EverFern
## Overview
A user may ask you to create, edit, or analyze the contents of an .xlsx file. On Windows, use Python libraries like `pandas` and `openpyxl`. Use absolute Windows paths (e.g., `C:\Users\Username\Downloads\data.xlsx`).
## Reading and Analyzing Data
### Data Analysis with pandas
For data analysis, visualization, and basic operations, use **pandas**:
```python
import pandas as pd
# Read Excel
df = pd.read_excel(r'C:\path\to\file.xlsx') # Default: first sheet
all_sheets = pd.read_excel(r'C:\path\to\file.xlsx', sheet_name=None) # All sheets as dict
# Analyze
print(df.head()) # Preview data
print(df.info()) # Column info
print(df.describe()) # Statistics
# Write Excel
df.to_excel(r'C:\path\to\output.xlsx', index=False)
```
---
## Modifying Excel Files
If the user wants you to edit existing spreadsheets while keeping formatting, or write formulas, use `openpyxl`.
### 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 updateable.
#### ❌ WRONG - Hardcoding Calculated Values
```python
total = df['Sales'].sum()
sheet['B10'] = total # Hardcodes 5000
```
#### ✅ CORRECT - Using Excel Formulas
```python
sheet['B10'] = '=SUM(B2:B9)'
```
---
## Common Workflows
### Creating New Excel Files
```python
# pip install openpyxl
from openpyxl import Workbook
from openpyxl