Generating Spreadsheets with AI

Claude can generate spreadsheet content directly. Here's how to prompt effectively.

Quick Prompts

Simple Budget

Create a film production budget spreadsheet with categories:
Talent, Equipment, Post-Production, Marketing

Include columns: Budget, Spent, Remaining (auto-calculated)
Output as inline CSV for a codex content item.

Schedule

Create a project schedule spreadsheet with:
- Phases: Pre-Production, Production, Post, Marketing
- Columns: Start Date, End Date, Duration (weeks), Status
- Status should be a dropdown: Not Started, In Progress, Complete

Output as .spreadsheet.yaml format.

Inventory

Create an equipment inventory spreadsheet:
- Items: Camera, Lenses (3 types), Tripod, Lighting Kit, Audio Recorder
- Columns: Item, Quantity, Unit Cost, Total Value, Location, Condition

Total Value should auto-calculate from Quantity × Unit Cost.

Prompt Template

For consistent results, use this template:

Create a [TYPE] spreadsheet with:

**Rows:**
- [List the row items/categories]

**Columns:**
- [Column 1]: [type, any constraints]
- [Column 2]: [type, any constraints]
- [Calculated Column]: [formula description]

**Output format:** [inline CSV | .spreadsheet.yaml | both]

**Additional requirements:**
- [Any specific formatting]
- [Default values]
- [Validation rules]

Example Outputs

Claude generates inline CSV:

content:
  - key: budget
    name: "Production Budget"
    type: spreadsheet
    width: 1/1
    value: |
      Category,Budget,Spent,Remaining
      Talent,50000,0,=B2-C2
      Equipment,25000,0,=B3-C3
      Post-Production,15000,0,=B4-C4
      Marketing,10000,0,=B5-C5

Claude generates .spreadsheet.yaml:

metadata:
  formatVersion: "1.0"
  generator: "claude-opus"
  created: "2025-01-25T12:00:00Z"

columns:
  - key: category
    title: "Category"
    type: text
    width: 150
    readOnly: true

  - key: budget
    title: "Budget"
    type: currency
    width: 120

  - key: spent
    title: "Spent"
    type: currency
    width: 120

  - key: remaining
    title: "Remaining"
    type: currency
    width: 120
    formula: "=B{row}-C{row}"

data:
  - category: "Talent"
    budget: 50000
    spent: 0

  - category: "Equipment"
    budget: 25000
    spent: 0

  - category: "Post-Production"
    budget: 15000
    spent: 0

  - category: "Marketing"
    budget: 10000
    spent: 0

Claude generates Python/Polars code:

import polars as pl

budget = pl.DataFrame({
    "Category": ["Talent", "Equipment", "Post-Production", "Marketing"],
    "Budget": [50000, 25000, 15000, 10000],
    "Spent": [0, 0, 0, 0],
})

# Add calculated column
budget = budget.with_columns([
    (pl.col("Budget") - pl.col("Spent")).alias("Remaining")
])

budget.write_csv("data/budget.csv")

Tips for Better Results

  1. Be specific about column types - "currency", "percentage", "date picker"
  2. Describe calculations clearly - "Remaining = Budget minus Spent"
  3. Specify the output format - inline CSV is simpler, .spreadsheet.yaml for full control
  4. Mention if columns should be read-only - protects labels from editing
  5. Request realistic sample data - helps verify formulas work