Fill a formula across a range
fill_formulaFill a whole range with one formula, adjusting relative references per cell like dragging the fill handle. Use it to apply calculations across rows or columns in Google Sheets.
Instructions
Write one formula into every cell of a range, with relative references adjusting per cell (like dragging the fill handle). For a formula in a single cell, update_cells works too.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"spreadsheetId": "<spreadsheetId>",
"range": "<range>",
"formula": "<formula>"
},
"name": "fill_formula"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | A1 range to fill, e.g. "D2:D100" | |
| sheet | No | Sheet (tab) name; defaults to the first sheet | |
| formula | Yes | The formula as written for the top-left cell of the range, e.g. "=B2*C2" | |
| spreadsheetId | Yes | Spreadsheet ID or full Google Sheets URL |