Excel Analysis
Transform Excel spreadsheets into actionable insights with powerful analysis
✨ The solution you've been looking for
Analyze Excel spreadsheets, create pivot tables, generate charts, and perform data analysis. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
See It In Action
Interactive preview & real-world examples
AI Conversation Simulator
See how users interact with this skill
User Prompt
I have a sales spreadsheet with columns for region, product, sales amount, and date. Can you help me analyze which regions are performing best and create a pivot table summary?
Skill Processing
Analyzing request...
Agent Response
Complete analysis with regional performance metrics, pivot tables, and visualizations showing sales trends
Quick Start (3 Steps)
Get up and running in minutes
Install
claude-code skill install excel-analysis
claude-code skill install excel-analysisConfig
First Trigger
@excel-analysis helpCommands
| Command | Description | Required Args |
|---|---|---|
| @excel-analysis sales-performance-analysis | Analyze quarterly sales data to identify trends and create management reports | None |
| @excel-analysis financial-data-consolidation | Merge multiple Excel files and perform financial calculations | None |
| @excel-analysis data-quality-and-cleaning | Clean messy Excel data and prepare it for analysis | None |
Typical Use Cases
Sales Performance Analysis
Analyze quarterly sales data to identify trends and create management reports
Financial Data Consolidation
Merge multiple Excel files and perform financial calculations
Data Quality and Cleaning
Clean messy Excel data and prepare it for analysis
Overview
Excel Analysis
Quick start
Read Excel files with pandas:
1import pandas as pd
2
3# Read Excel file
4df = pd.read_excel("data.xlsx", sheet_name="Sheet1")
5
6# Display first few rows
7print(df.head())
8
9# Basic statistics
10print(df.describe())
Reading multiple sheets
Process all sheets in a workbook:
1import pandas as pd
2
3# Read all sheets
4excel_file = pd.ExcelFile("workbook.xlsx")
5
6for sheet_name in excel_file.sheet_names:
7 df = pd.read_excel(excel_file, sheet_name=sheet_name)
8 print(f"\n{sheet_name}:")
9 print(df.head())
Data analysis
Perform common analysis tasks:
1import pandas as pd
2
3df = pd.read_excel("sales.xlsx")
4
5# Group by and aggregate
6sales_by_region = df.groupby("region")["sales"].sum()
7print(sales_by_region)
8
9# Filter data
10high_sales = df[df["sales"] > 10000]
11
12# Calculate metrics
13df["profit_margin"] = (df["revenue"] - df["cost"]) / df["revenue"]
14
15# Sort by column
16df_sorted = df.sort_values("sales", ascending=False)
Creating Excel files
Write data to Excel with formatting:
1import pandas as pd
2
3df = pd.DataFrame({
4 "Product": ["A", "B", "C"],
5 "Sales": [100, 200, 150],
6 "Profit": [20, 40, 30]
7})
8
9# Write to Excel
10writer = pd.ExcelWriter("output.xlsx", engine="openpyxl")
11df.to_excel(writer, sheet_name="Sales", index=False)
12
13# Get worksheet for formatting
14worksheet = writer.sheets["Sales"]
15
16# Auto-adjust column widths
17for column in worksheet.columns:
18 max_length = 0
19 column_letter = column[0].column_letter
20 for cell in column:
21 if len(str(cell.value)) > max_length:
22 max_length = len(str(cell.value))
23 worksheet.column_dimensions[column_letter].width = max_length + 2
24
25writer.close()
Pivot tables
Create pivot tables programmatically:
1import pandas as pd
2
3df = pd.read_excel("sales_data.xlsx")
4
5# Create pivot table
6pivot = pd.pivot_table(
7 df,
8 values="sales",
9 index="region",
10 columns="product",
11 aggfunc="sum",
12 fill_value=0
13)
14
15print(pivot)
16
17# Save pivot table
18pivot.to_excel("pivot_report.xlsx")
Charts and visualization
Generate charts from Excel data:
1import pandas as pd
2import matplotlib.pyplot as plt
3
4df = pd.read_excel("data.xlsx")
5
6# Create bar chart
7df.plot(x="category", y="value", kind="bar")
8plt.title("Sales by Category")
9plt.xlabel("Category")
10plt.ylabel("Sales")
11plt.tight_layout()
12plt.savefig("chart.png")
13
14# Create pie chart
15df.set_index("category")["value"].plot(kind="pie", autopct="%1.1f%%")
16plt.title("Market Share")
17plt.ylabel("")
18plt.savefig("pie_chart.png")
Data cleaning
Clean and prepare Excel data:
1import pandas as pd
2
3df = pd.read_excel("messy_data.xlsx")
4
5# Remove duplicates
6df = df.drop_duplicates()
7
8# Handle missing values
9df = df.fillna(0) # or df.dropna()
10
11# Remove whitespace
12df["name"] = df["name"].str.strip()
13
14# Convert data types
15df["date"] = pd.to_datetime(df["date"])
16df["amount"] = pd.to_numeric(df["amount"], errors="coerce")
17
18# Save cleaned data
19df.to_excel("cleaned_data.xlsx", index=False)
Merging and joining
Combine multiple Excel files:
1import pandas as pd
2
3# Read multiple files
4df1 = pd.read_excel("sales_q1.xlsx")
5df2 = pd.read_excel("sales_q2.xlsx")
6
7# Concatenate vertically
8combined = pd.concat([df1, df2], ignore_index=True)
9
10# Merge on common column
11customers = pd.read_excel("customers.xlsx")
12sales = pd.read_excel("sales.xlsx")
13
14merged = pd.merge(sales, customers, on="customer_id", how="left")
15
16merged.to_excel("merged_data.xlsx", index=False)
Advanced formatting
Apply conditional formatting and styles:
1import pandas as pd
2from openpyxl import load_workbook
3from openpyxl.styles import PatternFill, Font
4
5# Create Excel file
6df = pd.DataFrame({
7 "Product": ["A", "B", "C"],
8 "Sales": [100, 200, 150]
9})
10
11df.to_excel("formatted.xlsx", index=False)
12
13# Load workbook for formatting
14wb = load_workbook("formatted.xlsx")
15ws = wb.active
16
17# Apply conditional formatting
18red_fill = PatternFill(start_color="FF0000", end_color="FF0000", fill_type="solid")
19green_fill = PatternFill(start_color="00FF00", end_color="00FF00", fill_type="solid")
20
21for row in range(2, len(df) + 2):
22 cell = ws[f"B{row}"]
23 if cell.value < 150:
24 cell.fill = red_fill
25 else:
26 cell.fill = green_fill
27
28# Bold headers
29for cell in ws[1]:
30 cell.font = Font(bold=True)
31
32wb.save("formatted.xlsx")
Performance tips
- Use
read_excelwithusecolsto read specific columns only - Use
chunksizefor very large files - Consider using
engine='openpyxl'orengine='xlrd'based on file type - Use
dtypeparameter to specify column types for faster reading
Available packages
- pandas - Data analysis and manipulation (primary)
- openpyxl - Excel file creation and formatting
- xlrd - Reading older .xls files
- xlsxwriter - Advanced Excel writing capabilities
- matplotlib - Chart generation
What Users Are Saying
Real feedback from the community
Environment Matrix
Dependencies
Framework Support
Context Window
Security & Privacy
Information
- Author
- davila7
- Updated
- 2026-01-30
- Category
- productivity-tools
Related Skills
Excel Analysis
Analyze Excel spreadsheets, create pivot tables, generate charts, and perform data analysis. Use …
View Details →Xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, …
View Details →Xlsx
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, …
View Details →