AI Text Functions
Generate AI text content with AITEXT, AILIST, and AILISTH functions
Overview
SheetMagic provides three AI text generation functions that work with all supported AI providers. These functions allow you to generate content, create lists, and automate text-based tasks directly in Google Sheets.
AITEXT
Generate AI text responses for any question or task.
Syntax
=AITEXT(prompt, [context])Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Your question, task, or instruction for the AI |
context | string | No | Cell reference or additional context to include in the prompt |
Returns
AI-generated text response based on your prompt.
Examples
Basic usage:
=AITEXT("Write a product description for a wireless mouse")With cell reference:
=AITEXT("Write a product description for: " & A1)With context:
=AITEXT("Summarize this article", B1)Complex prompt with multiple cells:
=AITEXT("Write a " & A1 & " word description for " & B1 & " targeting " & C1)Use Cases
- Product descriptions
- Blog post introductions
- Email templates
- Social media captions
- Translation tasks
- Text summarization
- Data analysis explanations
AILIST
Create vertical lists with AI - each item appears in cells below.
Syntax
=AILIST(prompt, [context])Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Request for a list or series of items |
context | string | No | Cell reference or additional context |
Returns
A vertical array of AI-generated list items, with each item in a separate row below.
Examples
Generate a list of ideas:
=AILIST("Generate 10 blog post ideas about coffee")List based on cell content:
=AILIST("List 5 benefits of " & A1)Competitive research:
=AILIST("List the top 10 competitors for " & A1 & " in the " & B1 & " market")Use Cases
- Brainstorming lists
- Keyword research
- Feature lists
- Pros and cons
- Step-by-step instructions
- FAQ generation
AILISTH
Create horizontal lists with AI - each item appears in cells to the right.
Syntax
=AILISTH(prompt, [context])Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Request for a horizontal list or series |
context | string | No | Cell reference or additional context |
Returns
A horizontal array of AI-generated items, with each item in a separate column to the right.
Examples
Generate column headers:
=AILISTH("Generate 5 column headers for a CRM spreadsheet")Category generation:
=AILISTH("List 6 product categories for " & A1)Use Cases
- Column header generation
- Category lists
- Tag generation
- Horizontal data layouts
Configuration Options
All AI text functions respect the following settings configured in SheetMagic:
Temperature
Controls the creativity/randomness of responses.
| Value | Behavior |
|---|---|
| 0 | Deterministic, consistent responses |
| 1 | Balanced creativity (default) |
| 2 | Highly creative, more varied responses |
Temperature is not supported for reasoning models (o1, o3, o4).
Max Tokens
Controls the maximum length of the response. Default is 500 tokens.
Model Selection
Select your preferred AI model in SheetMagic settings. All text functions use the same model configuration.
Supported Providers
AI text functions work with all supported providers:
- OpenAI - GPT-5, GPT-4o, GPT-4o-mini, o1, o3, o4
- Claude - Opus 4.5, Sonnet 4.5, Haiku 4.5, and earlier versions
- Google Gemini - Gemini 2.5 Pro, Flash, Flash-Lite
- OpenRouter - 100+ models from multiple providers
- Straico - 60+ aggregated models
Best Practices
1. Be Specific in Prompts
// Less effective
=AITEXT("Write about coffee")
// More effective
=AITEXT("Write a 50-word product description for organic Colombian coffee beans, highlighting flavor notes and brewing recommendations")2. Use Cell References for Dynamic Content
=AITEXT("Write a " & A1 & " for " & B1 & " with a " & C1 & " tone")3. Include Format Instructions
=AITEXT("List 5 benefits of " & A1 & ". Format as bullet points.")4. Set Appropriate Context
=AITEXT("Suggest improvements for this product description", B1)Error Handling
Common errors and solutions:
| Error | Cause | Solution |
|---|---|---|
#ERROR! | Invalid API key | Verify your API key in SheetMagic settings |
#LOADING! | Request in progress | Wait for the response to complete |
#LIMIT! | Rate limit exceeded | Wait and retry, or upgrade your API plan |
#VALUE! | Empty prompt | Ensure prompt parameter is not empty |