Requirements for Outputs
🎯 Load Full PAI Context
Before starting any task with this skill, load complete PAI context:
read ~/.claude/PAI/SKILL.md
This provides access to:
- Complete contact list (Angela, Bunny, Saša, Greg, team members)
- Stack preferences (TypeScript>Python, bun>npm, uv>pip)
- Security rules and repository safety protocols
- Response format requirements (structured emoji format)
- Voice IDs for agent routing (ElevenLabs)
- Personal preferences and operating instructions
🔀 When to Use This Sub-Skill
This sub-skill activates when the user's request involves Excel spreadsheets (.xlsx, .xlsm, .csv, .tsv).
Explicit Triggers
- User mentions "create spreadsheet", "new Excel file", "Excel workbook"
- User requests "formulas", "financial model", "financial modeling"
- User wants to "recalculate" or "recalculate formulas"
- User says "analyze data in Excel", "read Excel", "Excel data analysis"
- User mentions .xlsx, .xlsm, .csv, or .tsv files
Contextual Triggers
- User provides path to .xlsx/.xlsm file
- User discusses calculations, projections, or financial data
- User mentions financial projections, revenue models, or valuations
- User wants to work with spreadsheet formulas or data
Workflow Routing
Creation Workflow (openpyxl):
- "Create spreadsheet", "new Excel file", "build financial model"
- User wants to create new .xlsx files with formulas and formatting
- Use openpyxl for formula support and Excel-specific features
Editing Workflow (openpyxl):
- "Edit spreadsheet", "modify Excel", "update cells"
- User wants to modify existing .xlsx files while preserving formulas
- Use
load_workbook() to preserve existing formatting and formulas
Data Analysis Workflow (pandas):
- "Analyze data", "read Excel", "data visualization"
- User wants to analyze or visualize data from Excel files
- Use pandas for powerful data manipulation and analysis
Financial Modeling Workflow:
- "Financial model", "revenue projections", "valuation model"
- User wants professional financial models with color coding
- Follow financial model standards (blue inputs, black formulas, green links)
Recalculation Workflow:
- "Recalculate", "update formula values", "calculate formulas"
- After creating/editing files with formulas
- MANDATORY step after using formulas - run
recalc.py script
All Excel files
Zero Formula Errors
- Every Excel model 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 format, style, and conventions when modifying files
- Never impose standardized formatting on files with established patterns
- Existing template conventions ALWAYS override these guidelines
Financial models
Color Coding Standards
Unless otherwise stated by the user or existing template
Industry-Standard Color Conventions
- Blue text (RGB: 0,0,255): Hardcoded inputs, 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 updated
Number Formatting Standards
Required Format Rules
- Years: Format as text strings (e.g., "2024" not "2,024")
- Currency: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")
- Zeros: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")
- Percentages: Default to 0.0% format (one decimal)
- Multiples: Format 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 =B5*1.05
Formula Error Prevention
- Verify all cell references are correct
- Check for off-by-one errors in ranges
- Ensure consistent formulas across all projection periods
- Test with edge cases (zero values, negative numbers)
- Verify no unintended circular references
Documentation Requirements for Hardcodes
- Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"
- 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: FactSet, 8/20/2025, Consensus Estimates Screen"
XLSX creation, editing, and analysis
Overview
A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.
Important Requirements
LibreOffice Required for Formula Recalculation: You can assume LibreOffice is installed for recalculating formula values using the recalc.py script. The script automatically configures LibreOffice on first run
Reading and analyzing data
Data analysis with pandas
For data analysis, visualization, and basic operations, use pandas which provides powerful data manipulation capabilities:
import 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.info() # Column info
df.describe() # Statistics
# Write Excel
df.to_excel('output.xlsx', index=False)
Excel File Workflows
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
# Bad: Calculating in Python and hardcoding result
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 applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.
Common Workflow
- Choose tool: pandas for data, openpyxl for formulas/formatting
- Create/Load: Create new workbook or load existing file
- Modify: Add/edit data, formulas, and formatting
- Save: Write to file
- Recalculate formulas (MANDATORY IF USING FORMULAS): Use the recalc.py script
python recalc.py output.xlsx
- Verify and fix any errors:
- The script returns JSON with error details
- If
status is errors_found, check 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
# Using openpyxl for formulas and formatting
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill, Alignment
wb = Workbook()
sheet = wb.active
# Add data
sheet['A1'] = 'Hello'
sheet['B1'] = 'World'
sheet.append(['Row', 'of', 'data'])
# Add formula
sheet['B2'] = '=SUM(A1:A10)'
# Formatting
sheet['A1'].font = Font(bold=True, color='FF0000')
sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
sheet['A1'].alignment = Alignment(horizontal='center')
# Column width
sheet.column_dimensions['A'].width = 20
wb.save('output.xlsx')
Editing existing Excel files
# Using openpyxl to preserve formulas and formatting
from openpyxl import load_workbook
# Load existing file
wb = load_workbook('existing.xlsx')
sheet = wb.active # or wb['SheetName'] for specific sheet
# Working with multiple sheets
for sheet_name in wb.sheetnames:
sheet = wb[sheet_name]
print(f"Sheet: {sheet_name}")
# Modify cells
sheet['A1'] = 'New Value'
sheet.insert_rows(2) # Insert row at position 2
sheet.delete_cols(3) # Delete column 3
# Add new sheet
new_sheet = wb.create_sheet('NewSheet')
new_sheet['A1'] = 'Data'
wb.save('modified.xlsx')
Recalculating formulas
Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided recalc.py script to recalculate formulas:
python recalc.py <excel_file> [timeout_seconds]
Example:
python recalc.py output.xlsx 30
The script:
- Automatically sets up LibreOffice macro on first run
- Recalculates all formulas in all sheets
- Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)
- Returns JSON with detailed error locations and counts
- Works on both Linux and macOS
Formula Verification Checklist
Quick checks to ensure formulas work correctly:
Essential Verification
Common Pitfalls
Formula Testing Strategy
Interpreting recalc.py Output
The script returns JSON with error details:
{
"status": "success", // or "errors_found"
"total_errors": 0, // Total error count
"total_formulas": 42, // Number of formulas in file
"error_summary": { // Only present if errors found
"#REF!": {
"count": 2,
"locations": ["Sheet1!B5", "Sheet1!C10"]
}
}
}
Best Practices
Library Selection
- pandas: Best for data analysis, bulk operations, and simple data export
- openpyxl: Best for complex formatting, formulas, and Excel-specific features
Working with openpyxl
- Cell indices are 1-based (row=1, column=1 refers to cell A1)
- Use
data_only=True to read calculated values: load_workbook('file.xlsx', data_only=True)
- Warning: If opened with
data_only=True and saved, formulas are replaced with values and permanently lost
- For large files: Use
read_only=True for reading or write_only=True for writing
- Formulas are preserved but not evaluated - use recalc.py to update values
Working with pandas
- Specify data types to avoid inference issues:
pd.read_excel('file.xlsx', dtype={'id': str})
- For large files, read specific columns:
pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])
- Handle dates properly:
pd.read_excel('file.xlsx', parse_dates=['date_column'])
Code Style Guidelines
IMPORTANT: When generating Python code for Excel operations:
- Write minimal, concise Python code without unnecessary comments
- Avoid verbose variable names and redundant operations
- Avoid unnecessary print statements
For Excel files themselves:
- Add comments to cells with complex formulas or important assumptions
- Document data sources for hardcoded values
- Include notes for key calculations and model sections
Examples
Example 1: Build a financial model
User: "Create a revenue projection model for the next 5 years"
→ Creates workbook with assumptions sheet + projections
→ Uses Excel formulas (=SUM, growth rates) not hardcoded values
→ Applies color coding (blue inputs, black formulas), runs recalc.py
Example 2: Analyze data from Excel file
User: "What are the top 10 customers by revenue in this spreadsheet?"
→ Reads Excel with pandas
→ Groups, sorts, and filters data
→ Returns summary with statistics
Example 3: Update existing spreadsheet
User: "Add a new column with profit margin calculations"
→ Loads workbook preserving existing formulas
→ Adds new column with margin formula referencing existing cells
→ Saves and recalculates to verify no errors
1---2name: xlsx3description: Create, read, analyze Excel workbooks — formulas, financial models, data analysis, recalculation, and CSV/TSV conversion. USE WHEN xlsx, Excel, spreadsheet, formulas, financial model, data analysis.4metadata:5 source: https://skillmd.com/skills/diegosouzapw/xlsx6---78# Requirements for Outputs910## 🎯 Load Full PAI Context1112**Before starting any task with this skill, load complete PAI context:**1314`read ~/.claude/PAI/SKILL.md`1516This provides access to:17- Complete contact list (Angela, Bunny, Saša, Greg, team members)18- Stack preferences (TypeScript>Python, bun>npm, uv>pip)19- Security rules and repository safety protocols20- Response format requirements (structured emoji format)21- Voice IDs for agent routing (ElevenLabs)22- Personal preferences and operating instructions2324## 🔀 When to Use This Sub-Skill2526This sub-skill activates when the user's request involves Excel spreadsheets (.xlsx, .xlsm, .csv, .tsv).2728### Explicit Triggers29- User mentions "create spreadsheet", "new Excel file", "Excel workbook"30- User requests "formulas", "financial model", "financial modeling"31- User wants to "recalculate" or "recalculate formulas"32- User says "analyze data in Excel", "read Excel", "Excel data analysis"33- User mentions .xlsx, .xlsm, .csv, or .tsv files3435### Contextual Triggers36- User provides path to .xlsx/.xlsm file37- User discusses calculations, projections, or financial data38- User mentions financial projections, revenue models, or valuations39- User wants to work with spreadsheet formulas or data4041### Workflow Routing4243**Creation Workflow (openpyxl):**44- "Create spreadsheet", "new Excel file", "build financial model"45- User wants to create new .xlsx files with formulas and formatting46- Use openpyxl for formula support and Excel-specific features4748**Editing Workflow (openpyxl):**49- "Edit spreadsheet", "modify Excel", "update cells"50- User wants to modify existing .xlsx files while preserving formulas51- Use `load_workbook()` to preserve existing formatting and formulas5253**Data Analysis Workflow (pandas):**54- "Analyze data", "read Excel", "data visualization"55- User wants to analyze or visualize data from Excel files56- Use pandas for powerful data manipulation and analysis5758**Financial Modeling Workflow:**59- "Financial model", "revenue projections", "valuation model"60- User wants professional financial models with color coding61- Follow financial model standards (blue inputs, black formulas, green links)6263**Recalculation Workflow:**64- "Recalculate", "update formula values", "calculate formulas"65- After creating/editing files with formulas66- MANDATORY step after using formulas - run `recalc.py` script6768## All Excel files6970### Zero Formula Errors71- Every Excel model MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?)7273### Preserve Existing Templates (when updating templates)74- Study and EXACTLY match existing format, style, and conventions when modifying files75- Never impose standardized formatting on files with established patterns76- Existing template conventions ALWAYS override these guidelines7778## Financial models7980### Color Coding Standards81Unless otherwise stated by the user or existing template8283#### Industry-Standard Color Conventions84- **Blue text (RGB: 0,0,255)**: Hardcoded inputs, and numbers users will change for scenarios85- **Black text (RGB: 0,0,0)**: ALL formulas and calculations86- **Green text (RGB: 0,128,0)**: Links pulling from other worksheets within same workbook87- **Red text (RGB: 255,0,0)**: External links to other files88- **Yellow background (RGB: 255,255,0)**: Key assumptions needing attention or cells that need to be updated8990### Number Formatting Standards9192#### Required Format Rules93- **Years**: Format as text strings (e.g., "2024" not "2,024")94- **Currency**: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")95- **Zeros**: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")96- **Percentages**: Default to 0.0% format (one decimal)97- **Multiples**: Format as 0.0x for valuation multiples (EV/EBITDA, P/E)98- **Negative numbers**: Use parentheses (123) not minus -12399100### Formula Construction Rules101102#### Assumptions Placement103- Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells104- Use cell references instead of hardcoded values in formulas105- Example: Use =B5*(1+$B$6) instead of =B5*1.05106107#### Formula Error Prevention108- Verify all cell references are correct109- Check for off-by-one errors in ranges110- Ensure consistent formulas across all projection periods111- Test with edge cases (zero values, negative numbers)112- Verify no unintended circular references113114#### Documentation Requirements for Hardcodes115- Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"116- Examples:117 - "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"118 - "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"119 - "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"120 - "Source: FactSet, 8/20/2025, Consensus Estimates Screen"121122# XLSX creation, editing, and analysis123124## Overview125126A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.127128## Important Requirements129130**LibreOffice Required for Formula Recalculation**: You can assume LibreOffice is installed for recalculating formula values using the `recalc.py` script. The script automatically configures LibreOffice on first run131132## Reading and analyzing data133134### Data analysis with pandas135For data analysis, visualization, and basic operations, use **pandas** which provides powerful data manipulation capabilities:136137```python138import pandas as pd139140# Read Excel141df = pd.read_excel('file.xlsx') # Default: first sheet142all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # All sheets as dict143144# Analyze145df.head() # Preview data146df.info() # Column info147df.describe() # Statistics148149# Write Excel150df.to_excel('output.xlsx', index=False)151```152153## Excel File Workflows154155## CRITICAL: Use Formulas, Not Hardcoded Values156157**Always use Excel formulas instead of calculating values in Python and hardcoding them.** This ensures the spreadsheet remains dynamic and updateable.158159### ❌ WRONG - Hardcoding Calculated Values160```python161# Bad: Calculating in Python and hardcoding result162total = df['Sales'].sum()163sheet['B10'] = total # Hardcodes 5000164165# Bad: Computing growth rate in Python166growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']167sheet['C5'] = growth # Hardcodes 0.15168169# Bad: Python calculation for average170avg = sum(values) / len(values)171sheet['D20'] = avg # Hardcodes 42.5172```173174### ✅ CORRECT - Using Excel Formulas175```python176# Good: Let Excel calculate the sum177sheet['B10'] = '=SUM(B2:B9)'178179# Good: Growth rate as Excel formula180sheet['C5'] = '=(C4-C2)/C2'181182# Good: Average using Excel function183sheet['D20'] = '=AVERAGE(D2:D19)'184```185186This applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.187188## Common Workflow1891. **Choose tool**: pandas for data, openpyxl for formulas/formatting1902. **Create/Load**: Create new workbook or load existing file1913. **Modify**: Add/edit data, formulas, and formatting1924. **Save**: Write to file1935. **Recalculate formulas (MANDATORY IF USING FORMULAS)**: Use the recalc.py script194 ```bash195 python recalc.py output.xlsx196 ```1976. **Verify and fix any errors**: 198 - The script returns JSON with error details199 - If `status` is `errors_found`, check `error_summary` for specific error types and locations200 - Fix the identified errors and recalculate again201 - Common errors to fix:202 - `#REF!`: Invalid cell references203 - `#DIV/0!`: Division by zero204 - `#VALUE!`: Wrong data type in formula205 - `#NAME?`: Unrecognized formula name206207### Creating new Excel files208209```python210# Using openpyxl for formulas and formatting211from openpyxl import Workbook212from openpyxl.styles import Font, PatternFill, Alignment213214wb = Workbook()215sheet = wb.active216217# Add data218sheet['A1'] = 'Hello'219sheet['B1'] = 'World'220sheet.append(['Row', 'of', 'data'])221222# Add formula223sheet['B2'] = '=SUM(A1:A10)'224225# Formatting226sheet['A1'].font = Font(bold=True, color='FF0000')227sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')228sheet['A1'].alignment = Alignment(horizontal='center')229230# Column width231sheet.column_dimensions['A'].width = 20232233wb.save('output.xlsx')234```235236### Editing existing Excel files237238```python239# Using openpyxl to preserve formulas and formatting240from openpyxl import load_workbook241242# Load existing file243wb = load_workbook('existing.xlsx')244sheet = wb.active # or wb['SheetName'] for specific sheet245246# Working with multiple sheets247for sheet_name in wb.sheetnames:248 sheet = wb[sheet_name]249 print(f"Sheet: {sheet_name}")250251# Modify cells252sheet['A1'] = 'New Value'253sheet.insert_rows(2) # Insert row at position 2254sheet.delete_cols(3) # Delete column 3255256# Add new sheet257new_sheet = wb.create_sheet('NewSheet')258new_sheet['A1'] = 'Data'259260wb.save('modified.xlsx')261```262263## Recalculating formulas264265Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided `recalc.py` script to recalculate formulas:266267```bash268python recalc.py <excel_file> [timeout_seconds]269```270271Example:272```bash273python recalc.py output.xlsx 30274```275276The script:277- Automatically sets up LibreOffice macro on first run278- Recalculates all formulas in all sheets279- Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)280- Returns JSON with detailed error locations and counts281- Works on both Linux and macOS282283## Formula Verification Checklist284285Quick checks to ensure formulas work correctly:286287### Essential Verification288- [ ] **Test 2-3 sample references**: Verify they pull correct values before building full model289- [ ] **Column mapping**: Confirm Excel columns match (e.g., column 64 = BL, not BK)290- [ ] **Row offset**: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)291292### Common Pitfalls293- [ ] **NaN handling**: Check for null values with `pd.notna()`294- [ ] **Far-right columns**: FY data often in columns 50+ 295- [ ] **Multiple matches**: Search all occurrences, not just first296- [ ] **Division by zero**: Check denominators before using `/` in formulas (#DIV/0!)297- [ ] **Wrong references**: Verify all cell references point to intended cells (#REF!)298- [ ] **Cross-sheet references**: Use correct format (Sheet1!A1) for linking sheets299300### Formula Testing Strategy301- [ ] **Start small**: Test formulas on 2-3 cells before applying broadly302- [ ] **Verify dependencies**: Check all cells referenced in formulas exist303- [ ] **Test edge cases**: Include zero, negative, and very large values304305### Interpreting recalc.py Output306The script returns JSON with error details:307```json308{309 "status": "success", // or "errors_found"310 "total_errors": 0, // Total error count311 "total_formulas": 42, // Number of formulas in file312 "error_summary": { // Only present if errors found313 "#REF!": {314 "count": 2,315 "locations": ["Sheet1!B5", "Sheet1!C10"]316 }317 }318}319```320321## Best Practices322323### Library Selection324- **pandas**: Best for data analysis, bulk operations, and simple data export325- **openpyxl**: Best for complex formatting, formulas, and Excel-specific features326327### Working with openpyxl328- Cell indices are 1-based (row=1, column=1 refers to cell A1)329- Use `data_only=True` to read calculated values: `load_workbook('file.xlsx', data_only=True)`330- **Warning**: If opened with `data_only=True` and saved, formulas are replaced with values and permanently lost331- For large files: Use `read_only=True` for reading or `write_only=True` for writing332- Formulas are preserved but not evaluated - use recalc.py to update values333334### Working with pandas335- Specify data types to avoid inference issues: `pd.read_excel('file.xlsx', dtype={'id': str})`336- For large files, read specific columns: `pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])`337- Handle dates properly: `pd.read_excel('file.xlsx', parse_dates=['date_column'])`338339## Code Style Guidelines340**IMPORTANT**: When generating Python code for Excel operations:341- Write minimal, concise Python code without unnecessary comments342- Avoid verbose variable names and redundant operations343- Avoid unnecessary print statements344345**For Excel files themselves**:346- Add comments to cells with complex formulas or important assumptions347- Document data sources for hardcoded values348- Include notes for key calculations and model sections349350## Examples351352**Example 1: Build a financial model**353```354User: "Create a revenue projection model for the next 5 years"355→ Creates workbook with assumptions sheet + projections356→ Uses Excel formulas (=SUM, growth rates) not hardcoded values357→ Applies color coding (blue inputs, black formulas), runs recalc.py358```359360**Example 2: Analyze data from Excel file**361```362User: "What are the top 10 customers by revenue in this spreadsheet?"363→ Reads Excel with pandas364→ Groups, sorts, and filters data365→ Returns summary with statistics366```367368**Example 3: Update existing spreadsheet**369```370User: "Add a new column with profit margin calculations"371→ Loads workbook preserving existing formulas372→ Adds new column with margin formula referencing existing cells373→ Saves and recalculates to verify no errors374```