Formula reference

Use these formulas directly in a cell. If you prefer to copy examples from the sidebar, go to Extensions → AI for Sheets → Use AI Formulas.

Which formula should I use?

  • Write or generate text: =GEN, =WRITE
  • Summarize or rewrite: =SUMMARIZE, =REPHRASE
  • Analyze a table: =ANALYZE
  • Translate: =TRANSLATE
  • Classify text: =SENTIMENT, =SPAM, =TAGS
  • Images: =VISION, =IMAGEN, =EDIT
  • PDFs: =PDF
  • Audio: =TRANSCRIBE
  • Up to date answers: =AISEARCH

Text formulas

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

Use =GEN for general purpose prompts. The optional context can be a cell, range, or a value you want the AI to reference. Set list_mode to 1 to return one item per row.

=GEN("Write 3 subject lines for this email", A2)
=GEN("List 5 blog title ideas about sales reporting",,1)

=WRITE(topic, [content_type])

Use =WRITE when you want a longer draft. content_type can be things like blog post, SEO article, or email.

=WRITE("Remote work best practices", "SEO article")

=ANALYZE(range)

Use =ANALYZE to get insights from a table range.

=ANALYZE(A1:D20)

=SUMMARIZE(text)

Use =SUMMARIZE to turn long notes into a short summary.

=SUMMARIZE(A2)

=REPHRASE(text)

Use =REPHRASE to rewrite a sentence in a clearer way.

=REPHRASE(A2)

=TRANSLATE(text, target_language)

Use =TRANSLATE for quick translations using natural language names (for example, French, Japanese).

=TRANSLATE(A2, "French")

=TAGS(text)

Use =TAGS to get comma separated tags.

=TAGS(A2)

=SENTIMENT(text)

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

=SENTIMENT(A2)

=SPAM(text)

Use =SPAM to classify content as spam or non-spam.

=SPAM(A2)

Files (images, PDFs, and audio)

For file URLs, you can use public links or generate URLs with Upload/Download Files. If a Drive link fails, see Make Drive images accessible.

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

Use =VISION to describe an image or extract details from it.

=VISION("Describe this image", A2)

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

Use =PDF to summarize a PDF or extract specific fields (for example, invoice numbers).

=PDF("Extract invoice number", A2)

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

Use =TRANSCRIBE to transcribe audio files like MP3, WAV, or M4A.

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

Images (generation and edits)

=IMAGEN and =EDIT return an image URL. Preview it with Google Sheets =IMAGE.

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

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

Supported aspect ratios: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9.

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

=EDIT("Remove background", A2)
=EDIT("Change sky to sunset", A2, "", "", "16:9")

Web search

=AISEARCH(query)

Use =AISEARCH when you need an answer based on current information from the web.

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

Frequently Asked Questions

Why does my formula show #NAME? or Unknown function?

This usually means the add-on is not installed, not authorized, or blocked by an admin. Start with Getting started and Common setup issues.

How do I stop formulas from re-running?

Use Save formula output to convert AI formulas into static values.

Do custom instructions affect these formulas?

Yes. You can set a global instruction and a sheet-specific instruction. See Custom instruction and cache.

Was this page helpful?

Your feedback helps improve this content.