---
title: ToolRouter — Tool Detail
description: Detailed documentation for a ToolRouter tool including skills, parameters, and examples.
url: https://toolrouter.com/tools/excel-tools
---
# Excel Tools

Create, read, and modify Excel (.xlsx) workbooks. Build complete spreadsheets with formulas, formatting, validations, pivot tables, and conditional formatting. Read any .xlsx into structured JSON. Apply 30+ batch operations to existing files. Returns downloadable .xlsx files.

- **Version:** 0.02
- **Categories:** productivity, data
- **Workflow:** create_spreadsheet → read_spreadsheet → modify_spreadsheet

## Skills (3)

### Create Spreadsheet (`create_spreadsheet`)

Build a complete Excel workbook in one call — multiple sheets, headers, formulas, rich formatting, merged cells, data validations, conditional formatting, hyperlinks, comments, named ranges, tables, pivot tables, sheet protection, freeze panes, and print setup. Returns a .xlsx file.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `sheets` | array | Yes | Array of sheet definitions with data and settings. |
| `formulas` | array | No | Formulas to apply. Each: {sheet?, cell, formula}. |
| `formatting` | array | No | Formatting rules. Each object needs a range and optional style properties (bold, italic, font_size, colors, alignment, etc.). |
| `merges` | array | No | Cell ranges to merge. |
| `data_validations` | array | No | Data validation rules. Types: list (dropdowns), whole/decimal (number ranges), date, textLength, custom (formula-based). |
| `conditional_formats` | array | No | Conditional formatting rules. rule_type: cellIs, containsText, colorScale, dataBar, iconSet, top10, aboveAverage, expression. |
| `hyperlinks` | array | No | Hyperlinks to add. |
| `comments` | array | No | Cell comments/notes. |
| `named_ranges` | array | No | Named ranges (defined names). |
| `tables` | array | No | Excel tables to create from existing data ranges. |
| `pivot_tables` | array | No | Pivot tables to compute from data. Creates a new sheet with aggregated results. |
| `filename` | string | No | Output filename (default: spreadsheet.xlsx) |

**Returns:** A downloadable .xlsx file with all sheets, data, formatting, validations, and formulas applied

**Examples:**

*Sales report with formatting and formulas:*

```json
{
  "sheets": [
    {
      "name": "Sales",
      "headers": [
        "Product",
        "Q1",
        "Q2",
        "Q3",
        "Q4"
      ],
      "rows": [
        [
          "Widget A",
          1500,
          2300,
          1800,
          2100
        ],
        [
          "Widget B",
          900,
          1100,
          1300,
          1500
        ]
      ]
    }
  ],
  "formulas": [
    {
      "cell": "F1",
      "formula": "\"Total\""
    },
    {
      "cell": "F2",
      "formula": "SUM(B2:E2)"
    },
    {
      "cell": "F3",
      "formula": "SUM(B3:E3)"
    }
  ],
  "formatting": [
    {
      "range": "B2:F3",
      "number_format": "$#,##0"
    }
  ],
  "filename": "sales-report.xlsx"
}
```

*Budget with dropdowns, conditional formatting, and pivot table:*

```json
{
  "sheets": [
    {
      "name": "Expenses",
      "headers": [
        "Department",
        "Category",
        "Amount",
        "Status"
      ],
      "rows": [
        [
          "Engineering",
          "Software",
          15000,
          "Approved"
        ],
        [
          "Marketing",
          "Ads",
          8000,
          "Pending"
        ],
        [
          "Engineering",
          "Hardware",
          22000,
          "Approved"
        ],
        [
          "Marketing",
          "Events",
          5000,
          "Rejected"
        ]
      ]
    }
  ],
  "data_validations": [
    {
      "range": "D2:D100",
      "type": "list",
      "values": [
        "Approved",
        "Pending",
        "Rejected"
      ],
      "error_title": "Invalid",
      "error_message": "Pick from the list"
    }
  ],
  "conditional_formats": [
    {
      "range": "C2:C100",
      "rule_type": "cellIs",
      "operator": "greaterThan",
      "value": 10000,
      "style_bg_color": "FFCCCC",
      "style_bold": true
    }
  ],
  "pivot_tables": [
    {
      "data_range": "A1:D5",
      "target_sheet": "Summary",
      "rows": [
        "Department"
      ],
      "values": [
        "Amount"
      ],
      "agg_func": "sum"
    }
  ],
  "filename": "budget.xlsx"
}
```

### Read Spreadsheet (`read_spreadsheet`)

Download an Excel file from a URL and extract all data as structured JSON — sheet names, headers, cell values, merged cells, tables, and print settings. Optionally includes formulas, comments, hyperlinks, data validations, and per-cell formatting. Use this to inspect a file before modifying it.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | Yes | URL of the .xlsx file to read. The tool server CAN fetch any public URL — always pass it. |
| `sheet_name` | string | No | Read only this sheet (omit to read all) |
| `start_cell` | string | No | Start reading from this cell (default: A1) |
| `end_cell` | string | No | Stop reading at this cell (omit to read all data) |
| `include_formulas` | boolean | No | Return raw formula strings per cell (default: false) |
| `include_comments` | boolean | No | Return cell comments/notes (default: false) |
| `include_hyperlinks` | boolean | No | Return hyperlink URLs per cell (default: false) |
| `include_data_validations` | boolean | No | Return data validation rules per cell (default: false) |
| `include_formatting` | boolean | No | Return font, color, border, number format per cell (default: false) |
| `include_metadata` | boolean | No | Return merged cells, freeze panes, tables, print setup, defined names (default: false) |

**Returns:** Structured JSON with all sheet data, cell values, and optional deep metadata (formulas, comments, hyperlinks, validations, formatting)

**Examples:**

*Read all data from a spreadsheet:*

```json
{
  "url": "https://example.com/report.xlsx"
}
```

*Deep inspection with all metadata:*

```json
{
  "url": "https://example.com/data.xlsx",
  "include_formulas": true,
  "include_comments": true,
  "include_data_validations": true,
  "include_formatting": true,
  "include_metadata": true
}
```

### Modify Spreadsheet (`modify_spreadsheet`)

Apply 30+ batch operations to an existing Excel file: write data, formulas, formatting, merges, sheets, rows/cols, tables, pivots, validations, conditional formats, hyperlinks, comments, protection, and print setup. Returns the modified .xlsx file.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `url` | string | Yes | URL of the .xlsx file to modify. The tool server CAN fetch any public URL — always pass it. |
| `operations` | array | Yes | Operations to apply in order. Each has an "action" field plus action-specific params. Optional "sheet" targets a specific sheet. |
| `filename` | string | No | Output filename (default: modified.xlsx) |

**Returns:** The modified .xlsx file with a summary of all operations applied

**Examples:**

*Add formulas, conditional formatting, and a pivot table:*

```json
{
  "url": "https://example.com/data.xlsx",
  "operations": [
    {
      "action": "add_formula",
      "cell": "E2",
      "formula": "SUM(B2:D2)"
    },
    {
      "action": "add_conditional_format",
      "range": "E2:E100",
      "rule_type": "colorScale",
      "color_min": "F8696B",
      "color_max": "63BE7B"
    },
    {
      "action": "create_pivot_table",
      "data_range": "A1:E50",
      "target_sheet": "Summary",
      "rows": [
        "Category"
      ],
      "values": [
        "Amount"
      ],
      "agg_func": "sum"
    }
  ]
}
```

*Add dropdowns, comments, hyperlinks, and protect the sheet:*

```json
{
  "url": "https://example.com/report.xlsx",
  "operations": [
    {
      "action": "add_data_validation",
      "range": "C2:C100",
      "type": "list",
      "values": [
        "Low",
        "Medium",
        "High",
        "Critical"
      ]
    },
    {
      "action": "add_comment",
      "cell": "A1",
      "text": "Updated by automation on 2026-03-22"
    },
    {
      "action": "add_hyperlink",
      "cell": "F2",
      "url": "https://example.com/details",
      "text": "View Details"
    },
    {
      "action": "protect_sheet",
      "password": "secret123"
    }
  ]
}
```

## Quick Start

```bash
# Via CLI
TOOLROUTER_API_KEY=tr_live_xxx npx -y toolrouter-mcp call excel-tools create_spreadsheet --sheets [object Object] --formulas [object Object],[object Object],[object Object] --formatting [object Object] --filename sales-report.xlsx

# Via REST API
curl -H "Authorization: Bearer tr_live_xxx" \
     -d '{"tool":"excel-tools","skill":"create_spreadsheet","input":{"sheets":[{"name":"Sales","headers":["Product","Q1","Q2","Q3","Q4"],"rows":[["Widget A",1500,2300,1800,2100],["Widget B",900,1100,1300,1500]]}],"formulas":[{"cell":"F1","formula":"\"Total\""},{"cell":"F2","formula":"SUM(B2:E2)"},{"cell":"F3","formula":"SUM(B3:E3)"}],"formatting":[{"range":"B2:F3","number_format":"$#,##0"}],"filename":"sales-report.xlsx"}}' \
     https://api.toolrouter.com/v1/tools/call
```

## Frequently Asked Questions

### Can I build a workbook from scratch?

Yes. `create_spreadsheet` can generate a complete .xlsx file with multiple sheets, formulas, formatting, validations, pivot tables, merged cells, and print setup.

### Can I read an existing spreadsheet into JSON?

`read_spreadsheet` extracts sheet data, cell values, and optional metadata such as formulas, comments, hyperlinks, validations, formatting, merged cells, and defined names.

### Can I modify a workbook without recreating it?

Yes. `modify_spreadsheet` applies batch edits to an existing file URL, including formulas, formatting, tables, pivots, comments, protection, and print settings.

### What Excel features are supported?

The tool covers the common power-user pieces: dropdown validations, conditional formatting, named ranges, freeze panes, tab colors, sheet protection, and structured tables.

---

## Get Started with ToolRouter

**Already connected?** Call any tool with `use_tool({ tool, skill, input })`. Browse tools with `discover` or visit https://toolrouter.com/llms-full.txt

**New to ToolRouter?** Connect with one command (no API key needed — auto-provisions on first use):

```bash
# MCP (Claude Code, Codex CLI)
claude mcp add toolrouter -- npx -y toolrouter-mcp

# MCP (Cursor, Windsurf, Cline, VS Code, Gemini CLI, Claude Desktop)
{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

# Claude Chat / Claude Cowork / Claude Mobile — add as a connector:
# Settings → Connectors → Add custom connector → URL: https://api.toolrouter.com/mcp

# ChatGPT — add as an app:
# Settings → Apps → Advanced settings → enable Developer mode → Create app → MCP Server URL: https://api.toolrouter.com/mcp

# CLI (works instantly, no restart needed)
npx -y toolrouter-mcp tools                    # browse all tools
npx -y toolrouter-mcp search "seo"             # search by keyword
npx -y toolrouter-mcp call seo analyze_page --url https://example.com
```

Free tools work immediately. For paid tools, visit https://toolrouter.com/claim to add credits.

All platforms: https://toolrouter.com/connect | Full catalog: https://toolrouter.com/llms-full.txt | Docs: https://toolrouter.com/docs