AI for Sheets formula reference

Use these formulas directly in a Google Sheets cell. If you want the built-in formula picker, open Extensions → AI for Sheets → 🚀 Use AI Formulas.

Last updated: 2026-07-19

Quick answer

Most users start with =GEN for writing, =ANALYZE for table summaries, =VISION / =PDF for files, and =AISEARCH for up-to-date answers. If you need broader spreadsheet reasoning instead of a single-cell formula, use Sheet Agent.

Which AI for Sheets formula should I use?

  • Write or generate text: =GEN, =WRITE
  • Summarize, rewrite, or translate: =SUMMARIZE, =REPHRASE, =TRANSLATE
  • Analyze a range or table: =ANALYZE
  • Classify text: =SENTIMENT, =SPAM, =TAGS
  • Analyze images: =VISION
  • Analyze PDFs: =PDF
  • Transcribe audio: =TRANSCRIBE
  • Generate or edit images: =IMAGEN, =EDIT
  • Get up-to-date answers from the web: =AISEARCH

If you are new to the add-on, start with Getting started. If a formula fails with Unknown function, permissions, or file-access errors, jump to Formula errors or Common issues.

Text formulas

=GEN(prompt, [context], [list_mode])

Use =GEN as the general-purpose AI formula. The optional second argument can be a cell, range, or extra context. Set list_mode to 1 when you want one result per row.

=GEN("Write 3 follow-up email subject lines", A2)
=GEN("List 5 Google Sheets dashboard ideas for a sales team",,1)

=WRITE(topic, [content_type])

Use =WRITE when you want a longer draft. If you omit content_type, it defaults to blog post.

=WRITE("Remote work best practices")
=WRITE("Quarterly sales recap", "email")

=ANALYZE(range)

Use =ANALYZE for fast summaries of a selected range. It works best when your input range has headers and a clean tabular structure.

=ANALYZE(A1:D20)

=SUMMARIZE(text_or_url)

Summarizes text, webpages, Google Docs/Sheets/Slides, PDF/image files, and YouTube videos.

URLs and files must be publicly accessible. Supported image formats are JPEG, PNG, GIF, and WebP.

=SUMMARIZE(A2)
=SUMMARIZE("https://example.com/article")
=SUMMARIZE("https://www.youtube.com/watch?v=VIDEO_ID")
=SUMMARIZE("https://docs.google.com/document/d/DOCUMENT_ID/edit")

=REPHRASE(text)

Use =REPHRASE to rewrite one sentence or paragraph in a clearer alternative wording.

=REPHRASE(A2)

=TRANSLATE(text, target_language, [instructions])

Use =TRANSLATE when you want a direct translation. Pass the target language in natural language, for example French, Japanese, or Traditional Chinese. The optional third argument takes instructions or a glossary cell or range, for example refund = Gutschrift. Glossary terms are used exactly.

=TRANSLATE(A2, "French")
=TRANSLATE(A2, "German", $F$2:$F$20)

=TAGS(text, [allowed_tags])

Use =TAGS when you want comma-separated topic tags for a sentence, product description, or article. Add an allowed tags list (comma-separated text or a range) to return only tags from that list, or none if nothing fits.

=TAGS(A2)
=TAGS(A2, "billing, shipping, refund, other")

=SENTIMENT(text)

Use =SENTIMENT to classify text as positive, neutral, or negative.

=SENTIMENT(A2)

=SPAM(text)

Use =SPAM to classify a message as spam or non-spam.

=SPAM(A2)

Files: images, PDFs, and audio

For file URLs, use direct links, public Google Drive links, or URLs created from Upload/Download Files. If a Drive file does not work, follow Make Drive images accessible.

=VISION(prompt, image_url) or =VISION(image_url)

Use =VISION to describe an image, extract text, or answer questions about what is in the file. One-argument usage is supported and defaults to a generic description prompt.

=VISION("Describe this image", A2)
=VISION(A2)

=PDF(prompt, pdf_url) or =PDF(pdf_url)

Use =PDF to summarize a PDF, extract fields, or answer questions about a document. One-argument usage is also supported.

=PDF("Extract invoice number", A2)
=PDF(A2)

=TRANSCRIBE(prompt, audio_url) or =TRANSCRIBE(audio_url)

Use =TRANSCRIBE for audio files such as MP3, WAV, or M4A. One-argument usage defaults to transcript-only output.

=TRANSCRIBE("Transcribe and return only the transcript.", A2)
=TRANSCRIBE(A2)

Images: generation and edits

=IMAGEN and =EDIT return an image URL. To preview the result in your sheet, wrap it with Google Sheets =IMAGE().

=IMAGEN(prompt, [aspect_ratio], [reference_image_url])

Use =IMAGEN to generate a new image. Supported aspect ratios are 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9.

=IMAGEN("A futuristic city skyline at sunset", "16:9")
=IMAGE(IMAGEN("A portrait photo with soft studio lighting", "9:16"))

=EDIT(prompt, image_url1, [image_url2], [image_url3], [aspect_ratio])

Use =EDIT to modify an existing image. You can optionally add reference images, and the aspect ratio can also be passed as the third argument in shorthand usage like =EDIT(prompt, image, "16:9").

=EDIT("Remove background", A2)
=EDIT("Change sky to sunset", A2, "16:9")
=EDIT("Use this second image as a style reference", A2, B2)

Web search

=AISEARCH(query)

Use =AISEARCH when the answer depends on fresh information from the web rather than only the model's prior knowledge.

=AISEARCH("Summarize the current economic outlook for 2026")

Troubleshooting and next steps

  • Formula says Unknown function: make sure the add-on is installed and reloaded, then check Getting started and Formula errors.
  • Image or PDF URL does not work: use Upload/Download Files or follow the Drive accessibility guide.
  • You want stable values instead of live formulas: select the cells and click Lock in the sidebar.
  • You want broader spreadsheet reasoning: use Sheet Agent instead of forcing everything into one cell.
  • Your old sheet still uses =GEMINI: open Edit → Find and replace, tick Also search within formulas, and replace =GEMINI( with =GEN(.

Frequently Asked Questions

What is the best AI for Sheets formula to start with?

Start with =GEN() for general writing and text tasks, =ANALYZE() for table summaries, =VISION() / =PDF() for files, and =AISEARCH() when you need current web information.

Why does =VISION() or =PDF() fail with a Google Drive link?

The file usually is not public enough for the formula to fetch. Follow Make Drive images accessible or upload the file with Upload/Download Files and use the generated URL.

Can I still use =GEMINI() in Google Sheets?

Some existing sheets may still contain =GEMINI(), but current AI for Sheets documentation and menu flow use =GEN(). To update them, open Edit → Find and replace, tick Also search within formulas, and replace =GEMINI( with =GEN(.

When should I use Sheet Agent instead of a formula?

Use formulas when you want a result in one cell. Use Sheet Agent when you want to ask broader questions across a spreadsheet, attach files, or iterate interactively instead of forcing a long prompt into one formula.

How do I stop AI formulas from re-running?

Select the finished cells and click Lock in the Use AI Formulas sidebar. The answers stay as values until you unlock them.

Was this page helpful?

Your feedback helps improve this content.