write_cells
Write values and formulas to Google Sheets cells by specifying a starting cell and a 2D array of data.
Instructions
Write values to cells. Supports formulas (start with =).
Examples: - write_cells("abc123", "Sheet1!A1", '[["Name", "Age"], ["Alice", 30]]') - write_cells("abc123", "Sheet1!E1", '[["=SUM(A1:D1)"], ["=SUM(A2:D2)"]]') - write_cells("abc123", "A1", '[["Header1", "Header2", "Header3"]]')
Args: spreadsheet_id: The ID from the spreadsheet URL. range_notation: Starting cell in A1 notation (e.g., "Sheet1!A1"). values: JSON 2D array. Each inner array is a row. Formulas: use "=SUM(A1:A10)", "=AVERAGE(B:B)", etc.
Returns: JSON with updated_cells count and updated_range.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | Yes | ||
| range_notation | Yes | ||
| spreadsheet_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |