TASK_SHEET_UPDATE enables you to manipulate spreadsheet data using natural language instructions processed by an AI language model. It allows you to perform operations such as data cleaning, generation, transformation, and analysis on your Google Sheets data.
=TASK_SHEET_UPDATE(range, prompt, model, image_url, additional_sheets, outputRange)
Parameter | Data Type | Required | Description |
---|---|---|---|
range |
|
Required | The range in the active sheet to operate on. For example,
|
prompt |
|
Required | The instructions for the data manipulation task. For example,
|
model |
|
Optional | The AI model to use in the format
|
image_url |
|
Optional | The URL of an image to include with the prompt, providing visual context. For example,
|
additional_sheets |
|
Optional | Additional sheets and ranges to include as input only. Use semicolons to separate multiple sheets. For example,
|
outputRange |
|
Optional | The range where the output should be placed. For example,
|
Use the additional_sheets parameter to include data from other sheets as context for the AI. This is useful when referencing data across multiple sheets.
=TASK_SHEET_UPDATE("A1:B10", "Format names in column A according to the format examples in Sheet2.", "Gemini/gemini-1.5-pro", "", "Sheet2(A1:C10)")
By default, TASK_SHEET_UPDATE modifies the original range. Use the outputRange parameter to preserve the original data and place the results in a new location.
=TASK_SHEET_UPDATE("A1:B10", "Create a summary of each person's information.", "Gemini/gemini-1.5-pro", "", "", "C1:C10")
Include an image for visual context using the image_url parameter. This is particularly useful for tasks requiring visual references.
=TASK_SHEET_UPDATE("A1:B10", "Format the data according to the template shown in the image.", "Gemini/gemini-1.5-pro", "https://example.com/template_image.jpg")
This example corrects spelling mistakes and standardizes capitalization in product names.
=TASK_SHEET_UPDATE("A2:A20", "Fix spelling errors in these product names and ensure consistent capitalization.")
This example reads company names from column A and generates professional email domains in column B without modifying the original names.
=TASK_SHEET_UPDATE("A2:B20", "Column A contains company names. Generate a professional email domain for each company in column B.", "", "", "", "B2:B20")
This example fills in missing values in column C by referencing mapping rules from Sheet2 and historical data from Sheet3.
=TASK_SHEET_UPDATE("A2:C10", "Fill in missing values in column C based on the mapping rules in Sheet2 and historical data in Sheet3.", "", "", "Sheet2(A1:B20);Sheet3")
This example analyzes sales data in columns A-D and categorizes transactions according to a color-coded system provided via an image, then places the results in column E.
=TASK_SHEET_UPDATE("A1:D20", "Analyze this sales data and categorize each transaction according to the color-coded system shown in the image. Add the category in column E.", "Gemini/gemini-1.5-pro", "https://example.com/category_legend.jpg", "", "A1:E20")
Ensure your range uses correct A1 notation (e.g.,
"A1:B10"
Rewrite your prompt to be more specific and include examples if necessary to clarify the desired output.
Break your task into smaller chunks when working with very large ranges, as AI models have token limits.
Specify column purposes in your prompt to ensure that data is placed correctly in the output.
Use the outputRange parameter to write results to a different location and preserve the original data.
Reduce the size of your input range, choose a faster model, or divide the task into smaller parts.
Yes, but for specialized formula generation, consider using the dedicated
TASK_FORMULA
There are limits based on the AI model used. It is generally best to keep your ranges under a few hundred cells for optimal performance.
Yes, although TASK_SHEET_UPDATE primarily processes cell values. Specify in your prompt if you need to preserve or work with specific data types.
Yes, if you specify an outputRange that is larger than your input range, the function can generate additional rows or columns.
Yes, it can read and modify formulas. Be clear in your prompt whether you want to alter the formulas themselves or only their displayed values.
While TASK_SHEET_UPDATE does not run automatically, you can set up a time-driven trigger in Apps Script to execute it on a regular schedule.
Sheet Workflows uses your configured API keys to communicate with AI providers. Review the privacy policies of your chosen provider to understand how your data is handled.
5 months ago
1 month ago
1 month ago