AI function · Google Sheets
AI function
AI runs a Gemini prompt from a Google Sheets cell. It handles text jobs such as summaries, categories and rewrites. Google also grounds it in Search results for current information.
Syntax
=AI(prompt, [value])On Excel: use COPILOT. Both run prompts in a cell. Review prompts and outputs after moving.
Arguments
| Argument | Required | Meaning |
|---|---|---|
| prompt | Yes | The instruction in quotes. |
| value | No | A cell or range for the prompt to read. |
Worked example
| A | B | |
|---|---|---|
| 1 | Customer feedback | Summary |
| 2 | Delivery was late but support fixed it |
=AI("Summarize in five words or fewer.",A2)Result: Varies. Example output: Late delivery, support resolved it
The prompt sets the task and length, and the cell supplies the text.
Try it
AI output needs a live Google account, and it can differ between runs.
Availability
| Platform | Status |
|---|---|
| Excel | Not available. See the COPILOT function. |
| Google Sheets | Requires a Google plan with AI features. A workplace admin may need to enable it. |
Common mistakes
- A #NAME? error usually means your account lacks access.
- Results can change, so copy approved results as values.
- Keep calculations and regulated reporting in standard formulas.
Do it with AI
Paste this prompt into Copilot, Gemini or another assistant. Check the result on a small sample first.
Write three AI function prompts that tag support tickets in A2 as Billing, Technical or Account, using one word only.