Back to blog
Apps ScriptJul 10, 2026·6 min read

When to Use Google Apps Script Instead of Formulas

A clear rule of thumb for choosing between a formula and an Apps Script — and how to avoid the trap of using the wrong one.

When to Use Google Apps Script Instead of Formulas

Formulas are the fastest way to make a spreadsheet do work. Apps Script is the right tool when a formula would be fragile, invisible, or impossible. Knowing which one to reach for saves days of maintenance later.

Start with a formula

If the answer can be expressed as "given these inputs, calculate this," a formula is almost always the better choice. It is transparent, recalculates automatically, and any teammate can read it.

QUERY, ARRAYFORMULA, FILTER, LET, and LAMBDA cover far more ground than most people use them for. Before writing a script, ask whether one of these would solve it.

Reach for Apps Script when...

You need to trigger on an event

A form submission, a scheduled time, an edit to a specific cell. Formulas cannot listen for events. Apps Script triggers can.

You need to talk to another system

Sending an email, calling an API, writing to a Google Doc, posting to Slack, creating a Calendar event. Anything outside the spreadsheet needs a script.

The logic is procedural

"Look at each row, and if it matches these conditions, do this, then that." A formula can sometimes fake this, but the result is unreadable and slow. A short script is clearer.

You need state that outlives a recalculation

Logging what changed, keeping an audit trail, remembering the last processed row. Formulas forget everything on refresh. Scripts can persist.

The trap in both directions

Using a script when a formula would do makes the sheet opaque — no one can see what is happening. Using a formula when a script is called for produces monster expressions that break silently.

A useful test: if you can explain the logic in one sentence to a non-technical teammate, a formula probably fits. If the sentence has "and then" more than twice, it is time for a script.

Keep them tidy

Whichever you choose, name it. Comment the script. Put important formulas in a named range or a helper cell with a label next to it. Future you will thank present you.

Have a workflow that should work better?

Tell us what is manual, repetitive, or difficult to manage. We’ll look at what a better system could look like.

Book a free call