add_sheet_named_range
Creates a named range in Google Sheets to replace cell references with a readable name, making formulas easier to maintain.
Instructions
Define a named range that formulas and scripts can reference by name.
Creates a persistent alias for a range — e.g., =SUM(TaxRate) instead of
=SUM(Config!B2:B2). Named ranges show up in the Data > Named ranges
sidebar and in formula autocomplete. Makes formulas more readable and
lets you move the underlying cells without breaking references. To use
the named range, write it bare in a formula (=TaxRate) — no quotes,
no sheet prefix.
Requires OAuth scope: https://www.googleapis.com/auth/spreadsheets (write).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_google_email | Yes | ||
| spreadsheet_id | Yes | Google Sheets spreadsheet ID (from the URL after `/d/`). | |
| name | Yes | Identifier for the range. Must start with a letter or underscore; can contain letters, digits, underscores. No spaces or special characters. Cannot be the same as an A1 cell reference (e.g., `A1`, `B2` are rejected). Examples: `TaxRate`, `Q1_Revenue`, `_Config`. | |
| range_name | Yes | A1-notation range being named. Sheet name required for multi-sheet workbooks, e.g., `"Sheet1!A1:B10"`, `"Config!B2"`. Single cells work (`Sheet1!B2`). Full-column/row refs (`Sheet1!A:A`, `Sheet1!1:1`) are accepted. Sheet names with spaces must be single-quoted: `"'My Sheet'!A1:B5"`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |