TASK_FORMAT is a powerful function within the Sheet Workflows Google Sheets Add-on that allows you to apply sophisticated formatting to your spreadsheet using natural language instructions. Instead of manually adjusting formatting settings for each cell or range, you can simply describe what you want in plain English, and the function will use AI to interpret and apply your formatting requests.
This function bridges the gap between your formatting intentions and the technical implementation, making complex spreadsheet styling accessible to users of all technical backgrounds.
Make headers bold, centered, and highlight them with background colors.
Format numerical data into currency, percentage, or custom formats.
Apply conditional formatting based on cell values or conditions.
Create visually distinct sections in your spreadsheet.
Freeze rows/columns for better navigation in large datasets.
Implement consistent styling across your spreadsheet.
Format dates and times in various formats.
Create readable tables with alternating row colors.
Highlight important data points or outliers.
Set up professional-looking dashboards without manual formatting.
TASK_FORMAT(range, prompt, [model], [freeze_range])
Parameter | Data Type | Required | Description |
---|---|---|---|
range |
|
Required | The cell range you want to format, using A1 notation (e.g.,
|
prompt |
|
Required | Your formatting instructions in natural language (e.g.,
|
model |
|
Optional | The AI model to use for interpreting your formatting instructions, in the format
|
freeze_range |
|
Optional | Range of cells which should NOT be modified (e.g.,
|
You can be precise about which cells should be formatted:
Entire columns:
"A:C"
Entire rows:
"1:5"
Specific ranges:
"A1:C5,E7:G10"
Example:
=TASK_FORMAT("A1:D10", "Make the first row bold and freeze it, then color all negative numbers in red")
Different AI models may have varying capabilities in understanding and implementing formatting instructions. You can specify the model to use:
=TASK_FORMAT("A1:Z20", "Create a professional-looking financial dashboard with appropriate colors", "Gemini/gemini-1.5-pro")
The
freeze_range
=TASK_FORMAT("A1:J30", "Format this as a data table with alternating row colors", "Gemini/gemini-1.5-pro", "A1:J1")
This example will freeze the first row, making headers visible as you scroll down the sheet.
You can use cell references for flexible formatting configurations:
=TASK_FORMAT(B2, A2, C2, D2)
Where:
B2 contains the range to format (e.g.,
"A1:E10"
A2 contains the formatting instructions
C2 contains the model name
D2 contains the freeze range
=TASK_FORMAT("A1:F1", "Make the headers bold, centered, with a light blue background and white text")
This will format the first row with bold, centered text on a light blue background with white text color.
=TASK_FORMAT("B2:B20", "Color cells green if the value is above 100, yellow if between 50-100, and red if below 50")
This applies color-coding based on cell values in column B.
=TASK_FORMAT("A1:E15", "Format as a professional financial table with the first row as headers (bold, centered, dark blue background), currency format for columns C-E, and alternate row colors for readability", "Gemini/gemini-1.5-pro", "A1:E1")
This creates a comprehensive table styling with frozen headers.
=TASK_FORMAT("A1:J20", "Format this as a sales dashboard. The first row contains headers, columns A-B contain product data, columns C-F contain quarterly sales data that should be formatted as currency, columns G-J contain percentage changes that should use percentage format with red for negative values and green for positive values")
This formats different sections of a dashboard with appropriate styling for each data type.
Be specific in your prompts: The more detailed your formatting instructions, the better the results will be.
Start with a clean sheet: Apply TASK_FORMAT to a clean, well-structured data set for optimal results.
Use appropriate ranges: Only include the cells you want to format in the range parameter.
Test on a copy first: When applying complex formatting, test on a copy of your data first.
Combine with freeze_range: Use the freeze_range parameter to keep headers visible when scrolling through large datasets.
Consider model capabilities: More advanced models like Gemini-1.5-pro may provide better results for complex formatting requests.
Build formatting gradually: For complex sheets, apply formatting in stages rather than trying to do everything at once.
Review and refine: After applying formatting, review the results and refine your prompt if needed.
Formatting not applied correctly:
Be more specific in your prompt
Try using a different AI model
Break down complex requests into multiple simpler requests
Error messages:
Check that your range is valid A1 notation
Verify you have the correct model syntax (provider/model_name)
Ensure you have set up API keys for the model provider
Performance issues with large ranges:
Break up large sheets into smaller sections
Apply formatting to the most important ranges first
Consider using multiple TASK_FORMAT calls for different sections
Model limitations:
If a model doesn't understand your request, try rephrasing
Some complex formatting may require multiple steps
Consider upgrading to a more capable model
"Error: Invalid range format":
Ensure you're using proper A1 notation (e.g.,
"A1:B10"
Check for typos or incorrect range references
Verify that sheet names are correct if included in the range
A: No, TASK_FORMAT operates on the active sheet only. You'll need to apply it separately to each sheet.
A: You can be quite specific, including font styles, colors, alignments, number formats, and conditional formatting. The AI models can understand complex natural language instructions.
A: While TASK_FORMAT itself doesn't save settings, you can save your formatting prompts in cells and reference them consistently.
A: Yes, it will apply the new formatting to the specified range. Use the freeze_range parameter to protect cells you don't want to change.
A: Yes, you can include conditional formatting instructions based on cell values, formulas, or other conditions.
A: If you're unsure, start with your default model. For complex formatting needs, models like Gemini-1.5-pro tend to perform better.
A: No, TASK_FORMAT only changes the appearance (formatting) of cells, not their content or formulas.
A: Yes, the formatting will be applied whether the cells are currently visible or hidden.
A: After entering the TASK_FORMAT function in a cell, click on the cell and then click the "Run" button in the Sheet Workflows sidebar to execute it.
A: The TASK_FORMAT function doesn't automatically reapply formatting when the sheet refreshes. You'll need to run it again if you want to reapply the same formatting.
5 months ago
1 month ago
1 month ago