ck:xlsx
ExcelファイルやCSVファイルなどを読み込み、編集、分析できるため、データ分析やグラフ作成、ピボットテーブルの作成、数式を使った計算などをビジネスで活用するSkill。
📜 元の英語説明(参考)
Create, edit, analyze spreadsheets (.xlsx, .csv, .tsv). Use for Excel formulas, data analysis, visualization, formatting, pivot tables, charts, formula recalculation.
🇯🇵 日本人クリエイター向け解説
ExcelファイルやCSVファイルなどを読み込み、編集、分析できるため、データ分析やグラフ作成、ピボットテーブルの作成、数式を使った計算などをビジネスで活用するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ck-xlsx.zip https://jpskill.com/download/23644.zip && unzip -o ck-xlsx.zip && rm ck-xlsx.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/23644.zip -OutFile "$d\ck-xlsx.zip"; Expand-Archive "$d\ck-xlsx.zip" -DestinationPath $d -Force; ri "$d\ck-xlsx.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ck-xlsx.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ck-xlsxフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] ck:xlsx
出力要件
すべての Excel ファイル
数式エラーをゼロにする
- すべての 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.05の代わりに=B5*(1+$B$6)を使用します。
数式エラーの防止
- すべてのセル参照が正しいことを確認します。
- 範囲におけるオフバイワンエラーをチェックします。
- すべての予測期間で数式の一貫性を確保します。
- エッジケース(ゼロ値、負の数)でテストします。
- 意図しない循環参照がないことを確認します。
ハードコードの文書化要件
- コメント、または(テーブルの末尾であれば)隣接するセルに記載します。書式: "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 が必須: recalc.py スクリプトを使用して数式値を再計算するために LibreOffice がインストールされていると仮定できます。このスクリプトは、初回実行時に LibreOffice を自動的に設定します。
データの読み取りと分析
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)'
これは、合計、パーセンテージ、比率、差分など、すべての計算に適用されます。スプレッドシートは、ソースデータが変更されたときに再計算できる必要があります。
一般的なワークフロー
- ツールの選択: データには pandas、数式/書式設定には openpyxl を使用します。
- 作成/読み込み: 新しいワークブックを作成するか、既存のファイルを読み込みます。
- 変更: データ、数式、書式設定を追加/編集します。
- 保存: ファイルに書き込みます。
- 数式の再計算(数式を使用する場合は必須):
recalc.pyスクリプトを使用します。python recalc.py output.xlsx - エラーの検証と修正:
- スクリプトはエラーの詳細を含む JSON を返します。
statusがerrors_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)'
# 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')
既存の Excel の編集
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Requirements for Outputs
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 =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 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
statusiserrors_found, checkerror_summaryfor 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
- [ ] 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 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=Trueto read calculated values:load_workbook('file.xlsx', data_only=True) - Warning: If opened with
data_only=Trueand saved, formulas are replaced with values and permanently lost - For large files: Use
read_only=Truefor reading orwrite_only=Truefor 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
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (10,403 bytes)
- 📎 LICENSE.txt (1,467 bytes)