Thursday, 3 Dec 2026 Global Edition
Live Wire
AI Today Daily AI journalism & intelligence
Front Page Tips & Tutorials Baca versi Indonesia

Bye #N/A: How to Write and Fix Spreadsheet Formulas with AI

Stop memorizing formulas. Learn a practical workflow for getting AI to write, test, and fix Excel and Google Sheets formulas you can actually trust.

Bye #N/A: How to Write and Fix Spreadsheet Formulas with AI

Ever stared at an empty cell, convinced “there's a formula for this,” then given up and crunched the numbers by hand? You're not alone. Memorizing VLOOKUP, SUMIFS, or QUERY syntax is painful — and the good news is you no longer have to. AI chatbots like ChatGPT, Claude, and Gemini are remarkably good at writing spreadsheet formulas. The catch: there's a gap between a formula that “seems to work” and one you can actually trust with your numbers. This article closes that gap with a seven-step workflow: describing your data properly, writing a sharp brief, testing without breaking anything, fixing errors fast, and building a personal formula library. Everything here is free to try today, in both Excel and Google Sheets.

1. Start with a Data Brief, Not a Formula Request

The most common mistake when asking AI for a formula is pasting a bare question with zero context. The model can't see your screen, so it guesses your sheet's structure — and those guesses often miss: wrong column positions, wrong date formats, wrong assumptions about where the data ends. Before requesting any formula, send a short “data brief”:

I'm using Google Sheets, US locale (comma separators).
Sheet "Orders": A=Date (MM/DD/YYYY), B=Product, C=Category,
D=Qty (number), E=Unit Price. Data fills rows 2-500.
Sample row: 10/01/2026 | Arabica Coffee | Beverages | 3 | 3.50

This small habit turns the AI's answer from a generic guess into a formula that uses the right ranges, formats, and separators from the start. Notice we also stated the locale: many regions use semicolons instead of commas as argument separators, and that mismatch is the number-one reason copy-pasted formulas from tutorials refuse to run.

2. Describe the Outcome; Let AI Pick the Function

Don't open with “give me a VLOOKUP.” For your case, INDEX/MATCH, XLOOKUP, or QUERY might be more robust when rows shift, or more concise for aggregation. Instead of prescribing the tool, describe the end result — including conditions and exceptions:

On the "Summary" sheet, put a formula in B2: total revenue for
October 2026, Beverages category only. Revenue = Qty x Unit Price.
The formula must keep working when data grows past row 500.
Also give me one alternative and its pros and cons.

That last line matters. Asking for an alternative forces the AI to explain the trade-offs between functions — and you absorb the reasoning for free. The durable skill here isn't memorizing syntax; it's describing problems clearly. That skill survives every app update.

3. Test in a Scratch Cell Before Touching Real Data

Treat every AI formula as a draft, not a verdict. Paste it into an empty helper column — say column H — never straight into your production column, then:

  1. Compare the results with a manual calculation on the first 3-5 rows. It's the fastest way to see where the logic went wrong.
  2. Probe edge cases: blank cells, text sitting in numeric columns, oddly formatted dates, or product names missing from the lookup table.
  3. Drag the formula down and check that cell references shift as intended — missing $ signs to lock ranges are a classic silent failure.

If even one test fails, don't deploy it. That failure is perfect material for the next step.

4. When It Errors, Send Full Evidence: Formula + Message + Sample

#N/A, #VALUE!, and #REF! aren't dead ends — they're clues, and AI reads them well when you hand over complete evidence. Don't just complain that “the formula is wrong.” Send three things at once: the formula, the exact error, and a sample row that triggers it:

This formula returns #N/A on some rows:
=VLOOKUP(B2, Categories!A:B, 2, FALSE)

Failing row: B2 contains "Arabica Coffee " (trailing space).
Sheet "Categories": column A holds product names, column B prices.
Expected: show the product's price. Why does it fail, and how do
I fix it so it doesn't happen again?

The usual suspects: hidden leading or trailing spaces (fix with TRIM), numbers stored as text or vice versa, and the wrong match mode. With this evidence-first pattern, the AI typically names the culprit in a single reply and hands you a corrected formula you can retest immediately.

5. Reverse-Engineer Inherited Formulas

Here's another classic: a spreadsheet containing a paragraph-long formula left behind by a colleague who has since left the company. Don't let it stay a black box. Paste it into AI and ask for a teardown:

Explain this formula line by line in plain language, then point out
which parts would break if I insert a new column in the middle
of the table:
[paste formula here]

You get two things back: an understanding of what the sheet actually does, and a risk map — which ranges are locked, which assumptions are hidden, which parts are fragile. It's the fastest way to safely maintain someone else's spreadsheet without rebuilding it from scratch or breaking the monthly report that already works.

6. Use AI as a Translator Between Excel and Google Sheets

Excel and Google Sheets are similar dialects, not identical languages. QUERY exists only in Google Sheets; XLOOKUP ships in modern Excel and in Google Sheets but not in older Excel versions; Sheets' ARRAYFORMULA maps to dynamic arrays in Excel 365. When you switch platforms — or receive a file from someone on the other ecosystem — ask AI to translate:

Convert this Google Sheets formula to Excel 365:
=QUERY(Orders!A:E, "select B, sum(D*E) where C = 'Beverages' group by B", 1)

Always name the target version, because Excel 365 differs from Excel 2019. A good answer swaps functions, adjusts separators, and flags anything with no perfect equivalent — QUERY has none in Excel, so expect a SUMIFS or FILTER rebuild.

7. Build a Tested Personal Formula Library

The habit that separates power users from everyone else: don't let verified formulas evaporate. Whenever a formula passes your tests, archive it in a sheet called “Formula Library” with three columns: purpose, the formula itself, and short notes (“lock ranges with $”, “wrap in IFERROR”).

The payoff compounds. A month later, when the same problem resurfaces, you copy from the library — or paste it into AI as a reference: “adapt this formula for a different category.” A 20-minute job becomes a two-minute one, and your spreadsheet turns into an appreciating asset instead of a recurring source of dread.

The pattern across all seven steps is consistent: AI types, you verify. AI-generated formulas are fast, but speed without testing just moves errors deeper into your file. Describe your data honestly, test in a scratch cell, send full evidence when something breaks, and archive what survives. Do this for a week, and VLOOKUP will stop being a reason to consider a career change.

References

Partner Spotlight Explore today’s curated technology offers