SheetMagicSheetMagic

Stop AI Formulas Recalculating in Google Sheets and Paying Twice

Keep AITEXT and other SheetMagic AI results from re-running in Google Sheets, so a reload never pays for the same answers again. How Keep Formula and Keep Apostrophe work, where results land, and when a re-run costs tokens.

Phil Nguyen · 7 min read

To stop SheetMagic AI formulas from re-running, open Extensions > SheetMagic > Open AI Settings and make sure Keep Formula and its Keep Apostrophe sub-setting are both on: the formula is saved as text ('=AITEXT(...)) and the result is written to the cell on its right. If you would rather not keep the formula at all, turn Keep Formula off and the formula is replaced by its result.

Both settings are on by default, so a finished formula does not run again and you never pay twice for an answer you already have.

Here is what that protects. Say a store owner drags AITEXT down 500 rows to write product descriptions, and each answer uses about 300 AI tokens. That is 150,000 tokens for the column. If those 500 cells stayed live and re-ran on the next reload, the same 150,000 tokens would be spent again for text she already had, and the new wording could overwrite copy she had already edited around. This guide explains what each setting combination does and how SheetMagic handles repeat runs.

Why do custom functions in Google Sheets recalculate?

A live custom function is a formula, so it can run again. SheetMagic's own settings panel says it plainly: a formula kept without the apostrophe "will re-execute on sheet reload". A live formula also re-evaluates when its inputs change.

One runaway case is a chain. If an AITEXT prompt reads another AI formula's output, and that output keeps changing, the first cell re-runs every time the second one does.

What does Keep Formula do in SheetMagic?

Keep Formula decides what happens to the formula once the AI answer comes back. The tooltip in the sidebar sums it up:

  • ON: the formula stays in its cell and the result is written to the cell on the right.
  • OFF: the formula is replaced by the result. The original formula is not kept.

Keep Formula is on by default. The same switch appears on the Text, Image, Audio and Video tabs of the sidebar, and it is one setting. It is saved with the spreadsheet rather than your account, so it applies to everyone who runs SheetMagic formulas in that file.

Here is how the three combinations behave:

SettingWhile it runsWhen it finishesRuns again?
Keep Formula OFF"Processing..." in the cellResult replaces the formulaNo, the formula is gone
Keep Formula ON, Keep Apostrophe ON (default)"Processing..." in the cellFormula saved as text '=..., result in the cell to the rightNo, the formula is now text
Keep Formula ON, Keep Apostrophe OFF"Formula saved (drag to copy). Results →"Live formula stays, result in the cell to the rightYes, on reload or when inputs change

If you want results that stay put, use either of the first two rows.

Why is my result one column to the right?

Because Keep Formula is on. With Keep Formula on, SheetMagic writes the answer into the next column on the same row, so the formula and its result sit side by side. Plan your sheet so that the column to the right of your AI formulas is free for results.

Errors are handled differently. An error result never goes to the cell on the right: it is written into the formula cell itself, so you can see what went wrong.

What is Keep Apostrophe and when do I need it?

Keep Apostrophe is a sub-setting that only appears when Keep Formula is on. When it is on, the formula is kept with an apostrophe prefix ('=...), which turns it into plain text and prevents automatic re-execution. When it is off, the formula is kept as a live formula and re-executes on sheet reload.

Keep Apostrophe is set separately for each sidebar tab: Text, Image, Audio and Video. Each one is on by default.

Turn it off only when you want a formula that keeps updating, for example a prompt that should react when you edit its input cell. Expect each re-run to be a new AI request, apart from the repeat and pause cases covered below.

To run a saved formula again later, edit the cell and delete the leading apostrophe. The cell becomes a live formula and runs again.

What can you do once the AI results stay put?

Frozen results are plain values, so the sheet is safe to work in:

  1. Sort, filter and share without re-running anything. With Keep Apostrophe on, the formula is text, so reordering 500 rows or sending the file to a client does not start 500 new AI requests.
  2. Re-run one row on purpose. Edit the prompt in a single cell and delete its apostrophe, and only that row runs again. Fixing 3 weak descriptions out of 500 costs 3 answers, not 500. (An unchanged prompt re-run within 10 minutes just gets the stored answer back, as covered below.)
  3. Edit the output by hand. The result sits in the cell to the right as ordinary text, so your edits stay. A live formula could replace them on its next run.
  4. Hand the file to a teammate safely. Keep Formula is saved with the spreadsheet, so the same setting applies when a colleague runs SheetMagic formulas in that file.

Which functions does this apply to?

Keep Formula and Keep Apostrophe cover SheetMagic's AI generation functions, grouped by sidebar tab:

TabFunctions
TextAITEXT, AILIST, AILISTH, AITRANSLATE
ImageAIIMAGE, GPTV
AudioAISPEECH
VideoAIVIDEO

For a refresher on what each one does, see how to use AI formulas in Google Sheets.

Does a re-run cost AI tokens again?

Not if it is an exact repeat within 10 minutes. When the same cell runs the same prompt again within 10 minutes, SheetMagic reuses the stored answer with no AI call, and the reused answer costs nothing.

SheetMagic also brakes runaway live formulas. If a live Keep Formula cell (Keep Apostrophe off) runs 5 times in 10 minutes, the next run is skipped and a note on the cell explains: "SheetMagic paused this cell: it ran 5 times in 10 minutes. It may read another AI result that keeps changing, which re-runs it each time. It will run again after 10 minutes." A paused run costs nothing either.

Outside those cases, a re-run is a new AI request. That is why keeping the default settings is the simplest way to protect your token balance. For running AI over many rows, see the batch processing guide.

How do async scrapers handle Keep Formula?

The scraping functions, such as GSEARCH, AMAZONSEARCH and YTSEARCH or the Apify-backed ZILLOWSEARCH and SIMILARWEB, run in the background and write their rows to a new results tab named after the scraper. The first column of that tab, Source, holds the address of the formula cell. Keep Formula decides what happens to the formula cell itself:

  • Keep Formula on, Keep Apostrophe on (the default): the formula is frozen as text ('=...) so it does not run again.
  • Keep Formula on, Keep Apostrophe off: the formula cell is left as a live formula.
  • Keep Formula off: the formula cell changes to a status such as ✅ 20 results → Instagram Scraper Results.

For the full AI toolkit, start at the AI in Google Sheets hub.

Text and scraping formulas run on the free allowance. Install from the Google Workspace Marketplace, no card, no expiry.

Install free for Google Sheets

About the author

Phil NguyenPhil builds SheetMagic, the Google Sheets add-on that brings AI and web scraping into the spreadsheet, used by 6,300+ people. He writes these guides from the formulas he runs on his own sheets.