create_pivot_table
Generate pivot tables in Excel by specifying source data, row/column labels, values, and aggregation functions. Automate data summarization and analysis for improved insights directly within your worksheets.
Instructions
Create pivot table in worksheet.
Args:
    filepath: Path to Excel file
    sheet_name: Name of worksheet containing source data
    data_range: Source data range (e.g., "A1:E100" or "Sheet2!A1:E100")
    rows: Field names for row labels
    values: Field names for values
    columns: Field names for column labels (optional)
    agg_func: Aggregation function (sum, count, average, max, min)
    target_sheet: Target sheet for pivot table (optional, auto-created if not exists)
    target_cell: Target cell for pivot table (optional, finds empty area if not provided)
    pivot_name: Custom name for pivot table (optional, auto-generated if not provided)
Input Schema
| Name | Required | Description | Default | 
|---|---|---|---|
| agg_func | No | mean | |
| columns | No | ||
| data_range | Yes | ||
| filepath | Yes | ||
| pivot_name | No | ||
| rows | Yes | ||
| sheet_name | Yes | ||
| target_cell | No | ||
| target_sheet | No | ||
| values | Yes | 
Input Schema (JSON Schema)
{
  "properties": {
    "agg_func": {
      "default": "mean",
      "title": "Agg Func",
      "type": "string"
    },
    "columns": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Columns"
    },
    "data_range": {
      "title": "Data Range",
      "type": "string"
    },
    "filepath": {
      "title": "Filepath",
      "type": "string"
    },
    "pivot_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Pivot Name"
    },
    "rows": {
      "items": {
        "type": "string"
      },
      "title": "Rows",
      "type": "array"
    },
    "sheet_name": {
      "title": "Sheet Name",
      "type": "string"
    },
    "target_cell": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Target Cell"
    },
    "target_sheet": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Target Sheet"
    },
    "values": {
      "items": {
        "type": "string"
      },
      "title": "Values",
      "type": "array"
    }
  },
  "required": [
    "filepath",
    "sheet_name",
    "data_range",
    "rows",
    "values"
  ],
  "title": "create_pivot_tableArguments",
  "type": "object"
}