> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Excel Operations

> Comprehensive Excel file manipulation tools

## Overview

Excel tools provide comprehensive functionality for working with Excel files (.xlsx). You can create new files from array data, read data, update cells, retrieve specific rows, extract embedded images, and manipulate Excel files from URLs.

## Key Features

* `EXCEL_CREATE`
  * Create a new Excel file from a 2D array and return a download URL
* `EXCEL_GET_ROWS`
  * Retrieve multiple rows from an Excel sheet as a 2D array, optionally limited to a range (e.g. "A1:C10")
* `EXCEL_GET_ROW`
  * Get a single row from an Excel sheet using a range (e.g. "A5:C5")
* `EXCEL_GET_CELL_WITH_COORDINATE`
  * Get cell values with their coordinates from a range defined by a start cell and an end cell
* `EXCEL_GET_IMAGES`
  * Extract images embedded in an Excel file, with their sheet name and cell range
* `EXCEL_UPDATE`
  * Update Excel file with new data using range selection
* `EXCEL_UPDATE_BY_COORDINATE`
  * Update specific cells using coordinate-based positioning

## Authentication

No authentication required. Excel tools work directly with file URLs.

### Example: Creating an Excel File

```yaml theme={null}
- id: create_excel
  name: create_excel
  tool: EXCEL_CREATE
  input:
    - name: data
      value: [
        ["Name", "Role", "Salary"],
        ["John Doe", "Manager", "50000"],
        ["Jane Smith", "Developer", "60000"]
      ]
    - name: sheetName
      value: "Members"
    - name: outputFilename
      value: "members.xlsx"
    - name: startCell
      value: "A1"
```

The result is a URL to download the created Excel file.

### Example: Reading Excel Data

```yaml theme={null}
- id: get_excel_rows
  name: get_excel_rows
  tool: EXCEL_GET_ROWS
  input:
    - name: url
      value: "https://example.com/data.xlsx"
    - name: sheetName
      value: "Sheet1"
    # Optional: omit range to read the entire sheet
    - name: range
      value: "A2:C10"

- id: get_specific_row
  name: get_specific_row
  tool: EXCEL_GET_ROW
  input:
    - name: url
      value: "https://example.com/data.xlsx"
    - name: sheetName
      value: "Sheet1"
    - name: range
      value: "A5:C5"

- id: get_cell_value
  name: get_cell_value
  tool: EXCEL_GET_CELL_WITH_COORDINATE
  input:
    - name: url
      value: "https://example.com/data.xlsx"
    - name: sheetName
      value: "Sheet1"
    - name: startCell
      value: "B5"
    - name: endCell
      value: "B5"

- id: get_images
  name: get_images
  tool: EXCEL_GET_IMAGES
  input:
    - name: url
      value: "https://example.com/data.xlsx"
    # Omit sheetName to extract images from all sheets
    - name: sheetName
      value: "Sheet1"
```

`EXCEL_GET_ROWS` returns the cell values as a 2D array in `result`, and `EXCEL_GET_ROW` returns a single row as an array. `EXCEL_GET_CELL_WITH_COORDINATE` returns an array of `{coordinate, content}` objects for each cell in the range from `startCell` to `endCell`.

`EXCEL_GET_IMAGES` returns a URL, file extension, MIME type, sheet name, and covered cell range for each extracted image, plus the total image count.

### Example: Updating Excel Data

```yaml theme={null}
- id: update_excel_range
  name: update_excel_range
  tool: EXCEL_UPDATE
  input:
    - name: url
      value: "https://example.com/template.xlsx"
    - name: sheetName
      value: "Data"
    - name: startCell
      value: "A2"
    - name: endCell
      value: "C4"
    - name: data
      value: [
        ["John Doe", "Manager", "50000"],
        ["Jane Smith", "Developer", "60000"],
        ["Bob Johnson", "Designer", "45000"]
      ]

- id: update_specific_cell
  name: update_specific_cell
  tool: EXCEL_UPDATE_BY_COORDINATE
  input:
    - name: url
      value: "https://example.com/report.xlsx"
    - name: sheetName
      value: "Summary"
    - name: updateData
      value: [
        {"coordinate": "E10", "content": "{{steps.calculate_total.result.sum}}"}
      ]
```

### Example: Excel Data Processing Workflow

```yaml theme={null}
- id: read_source_data
  name: read_source_data
  tool: EXCEL_GET_ROWS
  input:
    - name: url
      value: "{{secrets.EXCEL_SOURCE_URL}}"
    - name: sheetName
      value: "RawData"
    - name: range
      value: "A2:C100"

- id: process_data
  name: process_data
  tool: PYTHON_SANDBOX_RUN
  input:
    - name: code
      value: |
        import json
        
        # Get data from previous step (a 2D array of cell values)
        raw_data = {{steps.read_source_data.result}}
        
        # Process and transform data
        processed_data = []
        for row in raw_data:
            if row[0] and row[1]:  # Check if name and value exist
                processed_data.append([
                    row[0].upper(),  # Uppercase name
                    float(row[1]) * 1.1,  # Increase value by 10%
                    "Processed"
                ])
        
        print(json.dumps({"processed_data": processed_data}))

- id: update_target_excel
  name: update_target_excel
  tool: EXCEL_UPDATE
  input:
    - name: url
      value: "{{secrets.EXCEL_TARGET_URL}}"
    - name: sheetName
      value: "ProcessedData"
    - name: startCell
      value: "A2"
    - name: data
      value: "{{steps.process_data.result.processed_data}}"
```

## Tips and Best Practices

* Always specify the sheet name to avoid working with the wrong sheet
* Use coordinate notation (A1, B2, etc.) for precise cell references
* When updating ranges, ensure your data array dimensions match the specified range
* For large datasets, consider processing data in chunks to avoid timeouts
* Validate data format before updating Excel files to prevent errors
