TL;DR: Google Sheets has a real formula, =AI() (alias =GEMINI()), that runs a prompt against a cell range and returns text into the cell, plus a separate "Ask Gemini" panel that writes ordinary formulas for you. Both are documented, both have hard limits (no nesting, no undo, a 350-cell batch cap), and Docs has its own non-formula equivalent built around a Refine menu and a source-aware prompt bar.
Does Gemini Actually Write Real Formulas Inside Sheets and Docs?
Yes, in two genuinely different ways, and most write-ups blur them together. If you came looking for real gemini sheets prompts rather than another feature-list recap, here's the split that actually matters.
The first is a native spreadsheet function: =AI(). You type it into a cell the same way you'd type =SUM() or =VLOOKUP(), and it behaves like one, except the "calculation" it runs is a prompt against a language model. It stays live in the cell, referencing whatever range you gave it.
The second is the "Ask Gemini" side panel, a chat interface next to your spreadsheet (or a bottom bar in Docs) that you talk to in plain English. In Sheets, you can ask this panel to write you a completely ordinary formula, one that never mentions AI at all, like a SUMIFS or a VLOOKUP it figured out from your description. In Docs, the same panel drafts, rewrites, or restructures document text using your files as source material.
This post covers the documented syntax, limits, and access rules for both, sourced to Google's own current help pages (support.google.com/docs), each fetched and quoted on September 3, 2026.
What Is the Exact Syntax of Google Sheets' =AI() Function?
Google's own syntax reference is short:
AI("prompt", [range])
The prompt is a required, quoted instruction describing what you want. The range is optional: it's the cell or cells the prompt should read when generating its answer. Google's docs recommend always supplying a range rather than relying on wording alone, since "The AI function doesn’t have access to your entire spreadsheet or other files in your Google Drive" (support.google.com/docs/answer/15877199, accessed September 3, 2026) — it only sees what you explicitly pass it.
You can write the identical function two ways: =AI(...) or =GEMINI(...). Google's docs list both as interchangeable, and if you build a custom function under either name, your custom version gets remapped to the built-in one, not the other way round.
Four real examples, taken directly from Google's own published list:
=AI("Generate slogan for event in 10 words or less", A2)
=AI("For the customer, write a one sentence summary of their feedback.", A2:D2)
=AI("Classify the sentiment of the realtor analysis.", D2)
=AI("What is the current capital of Kazakhstan?", A2)
That last one is worth pausing on: the function can pull "up-to-date information from Google Search" for time-sensitive questions, not just reason over the cells you gave it, per the same support page.
You don't have to type the function by hand every time. At the top of the sheet, Insert > Function > AI inserts it for you, and once a table column has one completed =AI() cell, a drag handle or a one-click "Fill" action extends the same prompt down the rest of the column.
What Can't the =AI() Function Do?
The limitations list is longer than most write-ups mention, and knowing it upfront saves a lot of debugging:
- Text only. Responses are limited to text; you can't have
=AI()return a chart, an image, or a formatted number type of its own. - No full-sheet visibility. It reads only the range you pass it, never the rest of the workbook or other Drive files, by design.
- No undo or redo. Google's docs are direct about this: "You can’t undo or redo your function." You can regenerate the output, but a standard
Ctrl+Zdoesn't reverse it the way it would an ordinary edit. - No nesting. "Embedded AI functions aren’t supported." That rules out wrapping
=AI()inside=IF(),=VLOOKUP(), or anything else. If you need conditional logic on top of an AI result, let=AI()fill a helper cell first, then reference that cell from a normal formula. - A 350-cell batch cap. Select more AI-function cells than that and generate them together, and only the first 350 get generated per batch; the rest need a second pass.
- A cooldown on heavy use. There's a short-term and a long-term generation limit. Hit the long-term one and you can't click Generate again until you wait 24 hours.
- No non-Google storage. If you're accessing the sheet through Box, Dropbox, or Egnyte rather than native Google Drive, the function won't generate at all.
Which Version of the =AI() Function Do You Actually Have?
Google publishes two separate help articles for what is, on paper, the same function, and the difference is not cosmetic.
The general path ties access to "an eligible Google Workspace or Google AI plan", including personal Google AI Pro and Google AI Ultra subscribers, per support.google.com/docs/answer/15877199 (accessed September 3, 2026). If your organization's Workspace edition or your personal Google AI subscription includes it, =AI() is just there.
A separate article, support.google.com/docs/answer/15820999 (accessed September 3, 2026), covers Workspace Experiments, a trusted-tester program for personal accounts. If you got access this way, the exit terms are one-way: "If you exit, you can’t rejoin Workspace Experiments and permanently lose access to all Workspace Experiments features". Don't leave the program on a whim if a working =AI() sheet depends on it.
The two articles also differ in what they document about feedback and data handling: the Experiments version spells out exactly what gets collected (your prompts, ranges, and outputs) and where it's reviewed, while the general-availability page treats that as routine Workspace-with-Gemini feedback. If your organization has data-handling questions about =AI(), check which of the two articles actually describes your account.
How Do You Get Gemini to Write a Normal Formula For You?
This is the second, entirely separate mechanism, and it produces a formula you'd have written yourself if you'd known the syntax.
Open the Ask Gemini panel at the top right of the sheet, or start faster: click into any cell, type =, then use a keyboard shortcut to jump straight into formula help.
- Windows and Chrome OS: Ctrl + Alt + G
- Mac OS: ⌘ + Ctrl + G
Describe the formula you need in plain language, using either real cell references or generic column names. Google's own examples:
Create a formula that divides goals by games.
Create a formula to find cell C1 in range D:G and output value in column G.
Gemini proposes an ordinary formula (something you'd read as =A2/B2, not =AI(...)), and you click Insert to place it in the cell you selected, or Retry for a different version. Unlike =AI(), whatever lands in the cell is a normal formula: fully undoable, editable, and auditable the way any typed formula is.
There's a matching repair flow: when a formula cell shows an error, hover over it and click Fix. Gemini reviews the formula and the error together and proposes a correction, which you can accept or stop.
Which Should You Use: =AI() or Ask Gemini?
They solve different problems, and the table below is the fast way to pick.
| Feature | =AI() / =GEMINI() function | Ask Gemini formula panel |
|---|---|---|
| What lands in the cell | A live AI call, re-run on demand | A standard Sheets formula (SUMIFS, VLOOKUP, etc.) |
| Undo support | No — regenerate only | Yes, full undo/redo like any typed formula |
| Nesting | Not supported inside other functions | N/A — output is a normal formula, nest freely |
| Data it can see | Only the range you explicitly pass | Whatever range you describe in the prompt |
| How you trigger it | Type =AI( or =GEMINI( directly in a cell | Ask Gemini panel, or = then Ctrl+Alt+G / ⌘+Ctrl+G |
| Best for | Summaries, categorization, sentiment, quick web lookups | A calculation you can describe but can't write the syntax for |
What Does Formula-Level Prompting Look Like Inside Google Docs?
Docs has no formula concept, so the equivalent isn't syntax to memorize, it's a fixed set of documented prompt actions layered on top of your text.
A bottom-bar (or side-panel) prompt field drafts or edits content using files from Drive, Chat, Gmail, and the web, not just what's typed. Google's own description: "You can draft and refine content in Google Docs using information directly from your files in Drive, Chat, Gmail, and the web" (support.google.com/docs/answer/13447609, accessed September 3, 2026). A real example prompt from Google's own list for whole-document generation: "Blank financial report template for bakery in Q1 and Q2."
Refine, a fixed quick-action menu, appears when you select text: Rephrase, Shorten, Elaborate, Bulletize, Summarize, plus two tone shifts, More formal and More casual. No typed prompt needed for any of the seven; you click one and review the suggested change before accepting or rejecting it.
Referencing other files works the same way in both the drafting bar and Refine: type @ and search for a file, or use the Sources menu to add one from Drive or another location. Google's own documented example, for the goal "Update a project status": "Update the timeline in this document based on the latest project email from yesterday." (support.google.com/docs/answer/13447609, accessed September 3, 2026). That one pulls from Gmail rather than anything you typed.
Matching an existing writing style has one genuine wrinkle worth flagging precisely. Referencing a second Drive document to copy its tone, sentence structure, and vocabulary is currently documented as available through Workspace Experiments specifically for personal accounts, per support.google.com/docs/answer/13447609 (accessed September 3, 2026). A separate, narrower "Match writing style" quick action, which applies to content you've just pasted into the same document, is listed as a standard option in the Refine menu without that qualifier. Whether your organization's Business or Enterprise Workspace account gets the cross-document version outside the trusted-tester program isn't stated on that page either way.
Do You Need a Paid Plan for Any of This?
Every page cited above carries the identical line: "This feature requires an eligible Google Workspace or Google AI plan." There's no free tier for =AI(), the Ask Gemini formula panel, or Docs' Refine and prompt bar.
What that plan actually looks like has changed. Google's admin-facing help center states that, starting in January 2025, Business and Enterprise Workspace editions began including these AI features by default, and "Previously these features were included in Google Workspace with Gemini add-ons" (support.google.com/a/answer/15756885, accessed September 3, 2026) — the standalone Gemini Business and Gemini Enterprise add-ons were retired as part of that change. For a personal Google account, the equivalent is a paid Google AI Pro or Google AI Ultra subscription, explicitly named as covering these Sheets and Docs features on the pages above.
On February 5, 2026, Google introduced a further tier for teams that outgrow the standard allowance: AI Expanded Access, a Workspace add-on sitting between the default Business/Enterprise inclusion and the top AI Ultra Access add-on, aimed at raising usage ceilings on the heavier AI features across Workspace (workspaceupdates.googleblog.com/2026/02/google-workspace-ai-expanded-access.html, accessed September 3, 2026). The formula and prompt-bar features covered in this post are part of the standard inclusion, not gated behind that add-on specifically, but if your team is hitting generation limits on =AI() regularly, this is the add-on to ask an admin about.
Copy-Paste Prompts You Can Reuse Today
A mix of Google's own published examples and generalized templates, ready to adapt:
=AI("Categorize the customer inquiry as a compliment, exchange request, or return request.",C2)
=AI("Classify the body of the email, as either positive, negative, or neutral.", D2)
Create a formula that finds [value] in [range] and returns [output] from [column].
Convert the bulleted list in the 'To do' section into a three-column table.
Update the timeline in this document based on the latest project email from yesterday.
The first two are Google's own documented =AI() examples for Sheets. The fourth and fifth are Google's own documented Ask-Gemini prompts for Docs. The third is a generalized template for the many one-off Sheets formulas Google's own docs don't give a copy-paste example of.
Why Does My =AI() Formula Say "AI Function Not Available"?
Four documented causes, in the order Google lists them:
- No eligible access. You're either not on a Workspace or Google AI plan with the function enabled, or not a participant in Workspace Experiments if that's the path your account uses.
- Admin or language settings. An organization admin can restrict the feature, and it also depends on your account's language setting.
- A generation limit. Short-term limits clear quickly; a long-term limit means waiting a full 24 hours before Generate works again.
- Third-party storage. Opening the sheet through Box, Dropbox, or Egnyte instead of native Google Drive blocks generation entirely, regardless of plan.
If you've ruled out all four and it's still failing, that's the point to check with an admin rather than keep retrying, since none of the four produce a distinct error message beyond the same generic "not available" text.
Where Should a Formula Prompt That Actually Works Live?
Neither surface in this post keeps your work for you. Google's own Sheets and Docs help pages both warn that reloading your browser, closing and reopening the file, or going offline erases your Gemini panel conversation history, and =AI() itself has no undo, only regeneration. Once you've iterated a prompt into something that reliably returns the summary, category, or formula you actually wanted, that wording is worth keeping somewhere more durable than one spreadsheet's cell history.
That's a plain case for treating a working prompt template as an asset separate from the sheet it was written in: save the phrasing that worked, and the next Sheets column or Docs section that needs the same shape starts from a known-good prompt instead of a blank cell and a guess.
Stop rewriting prompts. Start shipping.
Works with ChatGPT, Claude, Gemini, Grok, Midjourney, Ideogram, Veo3 & Kling. 4.8★ on the Chrome Web Store.
Create An AccountKeep Going
This post covers the formula and prompt-syntax layer specifically. For the rest of Gemini's reach across Workspace, including Gmail and Slides, see our companion guide to prompting Gemini inside Google Workspace. For Gemini's non-Workspace surfaces: our guides to multi-modal prompting with Gemini (image, video, and audio in one conversation), prompting Gemini Live and voice mode, and Gemini vs ChatGPT prompting differences cover the app itself rather than the Workspace integration. If you want general-purpose Gemini prompt templates outside a spreadsheet or a document, our Gemini prompt templates collection is the multi-modal starting point.