jpskill.com
📄 ドキュメント Anthropic公式 🟢 非エンジニアでもOK 👤 経理・営業・データ分析

📈 Excel/CSV業務自動化

xlsx

Excel / CSV ファイルの読み取り・編集・計算・整形・グラフ化を完全自動化するSkill。

⏱ 会議議事録の整形 1時間 → 3分

📺 まず動画で見る(YouTube)

▶ Claude最新!PowerPoint, Excel, Wordを生成できる機能を解説 ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Excel / CSV ファイルの読み取り・編集・計算・整形・グラフ化を完全自動化するSkill。

日本人がよく使う場面
・経費集計表の月次自動更新 ・売上データの加工と可視化 ・名簿の重複削除・整形 ・乱雑な CSV を整理された Excel に ・複数シートをまたいだ集計

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
54

💬 こう話しかけるだけ — サンプルプロンプト

  • この経費CSVをカテゴリ別に集計して、合計を Excel にして
  • 社員名簿のExcelから重複行を削除して、フリガナ順に並べ替えて
  • 月次売上データをグラフ付きの集計シートにして
  • このCSV、文字化けして列がずれてる。直して綺麗な Excel に
  • 3つの店舗の売上Excelを 1ファイルにまとめて、店舗別シート + 全店合計シート

これをClaude Code に貼るだけで、このSkillが自動発動します。

📺 実際の使用例(入出力サンプル)

入力

「店舗別の売上CSVが12個ある。これを1つの Excel ブックに統合して、各店舗をシート、最後に全店合計シートを作って、ピボットテーブルで月次集計まで」

Claude の出力

  • sales_2026Q1_consolidated.xlsx 生成
  • シート1〜12:各店舗の生データ
  • シート13:全店合計(月別/店舗別マトリクス)
  • シート14:ピボットテーブル + グラフ

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[スキル名] xlsx

成果物の要件

すべての Excel ファイル

プロフェッショナルなフォント

  • ユーザーから別途指示がない限り、すべての成果物で一貫したプロフェッショナルなフォント(例:Arial、Times New Roman)を使用してください。

数式エラーゼロ

  • すべての Excel モデルは、数式エラー(#REF!、#DIV/0!、#VALUE!、#N/A、#NAME?)がゼロの状態で納品されなければなりません。

既存テンプレートの保持(テンプレート更新時)

  • ファイルを修正する際は、既存の形式、スタイル、慣例を研究し、正確に一致させてください。
  • 確立されたパターンを持つファイルに、標準化された書式設定を強制しないでください。
  • 既存のテンプレートの慣例は、常にこれらのガイドラインよりも優先されます。

財務モデル

色分けの基準

ユーザーまたは既存のテンプレートから別途指示がない限り

業界標準の色分けの慣例

  • 青色のテキスト (RGB: 0,0,255): ハードコードされた入力値、およびユーザーがシナリオのために変更する数値
  • 黒色のテキスト (RGB: 0,0,0): すべての数式と計算
  • 緑色のテキスト (RGB: 0,128,0): 同じブック内の他のワークシートからデータを取得するリンク
  • 赤色のテキスト (RGB: 255,0,0): 他のファイルへの外部リンク
  • 黄色の背景 (RGB: 255,255,0): 注意が必要な主要な仮定、または更新が必要なセル

数値書式設定の基準

必須書式設定ルール

  • : テキスト文字列として書式設定してください(例:「2024」であり「2,024」ではない)。
  • 通貨: $#,##0 形式を使用し、常にヘッダーで単位を指定してください(例:「Revenue ($mm)」)。
  • ゼロ: パーセンテージを含むすべてのゼロを「-」にするために数値書式設定を使用してください(例:「$#,##0;($#,##0);-」)。
  • パーセンテージ: デフォルトで 0.0% 形式(小数点以下1桁)を使用してください。
  • 倍率: 評価倍率(EV/EBITDA、P/E)は 0.0x として書式設定してください。
  • 負の数: マイナス記号 -123 ではなく、括弧 (123) を使用してください。

数式作成ルール

仮定の配置

  • すべての仮定(成長率、マージン、倍率など)は、個別の仮定セルに配置してください。
  • 数式では、ハードコードされた値ではなくセル参照を使用してください。
  • 例: =B5*(1+$B$6) を使用し、=B5*1.05 は使用しないでください。

数式エラーの防止

  • すべてのセル参照が正しいことを確認してください。
  • 範囲におけるオフバイワンエラーをチェックしてください。
  • すべての予測期間で一貫した数式であることを確認してください。
  • エッジケース(ゼロ値、負の数)でテストしてください。
  • 意図しない循環参照がないことを確認してください。

ハードコードの文書化要件

  • コメントとして、または(テーブルの末尾にある場合は)隣接するセルに記載してください。形式:「Source: [System/Document], [Date], [Specific Reference], [URL if applicable]」
  • 例:
    • "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 の作成、編集、分析

概要

ユーザーは、.xlsx ファイルの内容を作成、編集、または分析するよう依頼する場合があります。タスクに応じて、さまざまなツールとワークフローを利用できます。

重要な要件

数式再計算には LibreOffice が必須: scripts/recalc.py スクリプトを使用して数式値を再計算するために LibreOffice がインストールされていると仮定できます。このスクリプトは、初回実行時に LibreOffice を自動的に構成します。これには、Unix ソケットが制限されているサンドボックス環境も含まれます(scripts/office/soffice.py が処理します)。

データの読み取りと分析

pandas を使用したデータ分析

データ分析、視覚化、および基本的な操作には、強力なデータ操作機能を提供する pandas を使用してください。

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 ファイルのワークフロー

重要: ハードコードされた値ではなく、数式を使用する

Python で値を計算してハードコードするのではなく、常に Excel の数式を使用してください。 これにより、スプレッドシートが動的で更新可能な状態に保たれます。

❌ 誤り - 計算された値のハードコーディング

# 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

✅ 正しい - Excel 数式の使用

# 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)'

これは、合計、パーセンテージ、比率、差分など、すべての計算に適用されます。スプレッドシートは、ソースデータが変更されたときに再計算できる必要があります。

一般的なワークフロー

  1. ツールの選択: データには pandas、数式/書式設定には openpyxl を使用します。
  2. 作成/読み込み: 新しいブックを作成するか、既存のファイルを読み込みます。
  3. 変更: データ、数式、書式設定を追加/編集します。
  4. 保存: ファイルに書き込みます。
  5. 数式の再計算 (数式を使用する場合は必須): scripts/recalc.py スクリプトを使用します。
    python scripts/recalc.py output.xlsx
  6. エラーの検証と修正:
    • スクリプトはエラーの詳細を含む JSON を返します。
    • statuserrors_found の場合、error_summary で特定のエラーの種類と場所を確認します。
    • 特定されたエラーを修正し、再度再計算します。
    • 修正すべき一般的なエラー:
      • #REF!: 無効なセル参照
      • #DIV/0!: ゼロ除算
      • #VALUE!: 数式内のデータ型が間違っている
      • #NAME?: 認識されない数式名

新しい Excel ファイルの作成

# 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)'

# F
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Requirements for Outputs

All Excel files

Professional Font

  • Use a consistent, professional font (e.g., Arial, Times New Roman) for all deliverables unless otherwise instructed by the user

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 =B51.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 scripts/recalc.py script. The script automatically configures LibreOffice on first run, including in sandboxed environments where Unix sockets are restricted (handled by scripts/office/soffice.py)

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

  1. Choose tool: pandas for data, openpyxl for formulas/formatting
  2. Create/Load: Create new workbook or load existing file
  3. Modify: Add/edit data, formulas, and formatting
  4. Save: Write to file
  5. Recalculate formulas (MANDATORY IF USING FORMULAS): Use the scripts/recalc.py script
    python scripts/recalc.py output.xlsx
  6. 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 scripts/recalc.py script to recalculate formulas:

python scripts/recalc.py <excel_file> [timeout_seconds]

Example:

python scripts/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

  • [ ] Test 2-3 sample references: Verify they pull correct values before building full model
  • [ ] Column mapping: Confirm Excel columns match (e.g., column 64 = BL, not BK)
  • [ ] Row offset: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)

Common Pitfalls

  • [ ] NaN handling: Check for null values with pd.notna()
  • [ ] Far-right columns: FY data often in columns 50+
  • [ ] Multiple matches: Search all occurrences, not just first
  • [ ] Division by zero: Check denominators before using / in formulas (#DIV/0!)
  • [ ] Wrong references: Verify all cell references point to intended cells (#REF!)
  • [ ] Cross-sheet references: Use correct format (Sheet1!A1) for linking sheets

Formula Testing Strategy

  • [ ] Start small: Test formulas on 2-3 cells before applying broadly
  • [ ] Verify dependencies: Check all cells referenced in formulas exist
  • [ ] Test edge cases: Include zero, negative, and very large values

Interpreting scripts/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 scripts/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

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。