ReplyLabs
FeaturesPricingCompareFAQUse casesBlogHelpSetup
Sign inGet started free
Get started

Product

  • Features
  • Pricing
  • Compare
  • Roadmap

Resources

  • Use cases
  • Blog
  • Glossary
  • Cost calculator

Support

  • Setup Guide
  • Help Center
  • Contact Support
  • Report an Issue
  • Feature Requests

Company

  • Opt Out of Testing

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie list
  • Subprocessors

Empra Consultancy LTD
hello@replylabs.io

ReplyLabs|PrivacyTermsCookiesSubprocessors

© 2026 Empra Consultancy LTD. All rights reserved.

All articles
AI in Google Sheets

How to write an AI formula in Google Sheets (no script)

Write an AI formula that runs a prompt over a column in Google Sheets, without Apps Script. The fastest method, why custom functions fail, and the cost.

By Hugo Dupont · 3 min read

To write an AI formula in Google Sheets, the most reliable method is a sidebar add-on rather than a custom =AI() function. You write a prompt once, reference your columns by header (for example {{Company}}), and the add-on runs the model on every selected row and writes the result back. This avoids the six-minute Apps Script limit that breaks script-based AI functions on large ranges. Below is the exact method, why custom functions fall short, and what a run costs.

The fastest method, step by step

  1. Install ReplyLabs from Extensions, Get add-ons, then open it with Extensions, ReplyLabs, Open sidebar.
  2. Select the column range you want the formula to run on.
  3. In the AI tab, write your prompt and reference input columns by header, for example "Summarise {{Notes}} in one sentence."
  4. Check the cost preview for your row count.
  5. Click Run. Output appears in a new column, one row at a time.

This behaves like a formula in that one instruction fills a whole column, but it runs server-side so it scales to thousands of rows.

Why a custom =AI() function struggles

You can write an Apps Script custom function that calls a model. It works for a handful of cells and then hits walls:

  • The six-minute limit. Apps Script kills any execution that runs longer, so a few hundred rows can fail mid-way.
  • Quota on external calls. UrlFetchApp is rate-limited per day, which a real list exhausts quickly.
  • Recalculation storms. Sheets re-runs custom functions on edit, so the model gets called again and you pay again.

A batched add-on dispatches rows in parallel outside the spreadsheet, so none of these apply.

Make the formula write better output

The "formula" is really a prompt, and a sharper prompt fills the column with sharper text. Three quick wins:

  • Pass real facts, not just a name. A prompt that references a scraped detail or a verified field writes output specific to one row instead of generic filler.
  • Handle blanks explicitly. Add a line such as "If {{Notes}} is empty, write a short generic summary" so the model never invents data.
  • Lock the format. Ask for "one sentence" or "exactly one of: Yes, No" so the result is easy to filter and use in the next step.

What a run costs

ReplyLabs prices AI at the provider's raw cost times 1.25 plus a $0.0025 base fee per succeeded row, and only succeeded rows are charged. The cost preview shows the exact figure before you run. On Pro and Scale you can bring your own AI key and pay only the provider's raw rate. To model a specific run, use the AI cost calculator.

Common questions

Can I reference other cells in the prompt?

Yes. Reference any column by its header in double braces, for example {{First name}} or {{Company}}, and the value for that row is substituted before the model runs.

Is there a real =AI() formula?

ReplyLabs runs from the sidebar rather than a cell formula, on purpose: it sidesteps the Apps Script limits above and lets you preview cost before spending. The full picture is in the AI in Google Sheets guide.

What does an AI prompt mean here?

The instruction template you write once and apply to every row. See the AI prompt definition.

Keep reading: AI in Google Sheets
Read the full guide: AI in Google Sheets: the complete guide
  • Best AI tools for Google Sheets
  • Run a prompt across thousands of rows
Definitions
AI promptToken (LLM)

Try it on your own list

ReplyLabs runs from a sidebar inside Google Sheets. Start free with $20 credit, no card needed.

Get started free