Get Excel and Sheets formulas from AI and check them before you trust them

Ask for one formula, test it on five rows whose answers you already know, and only then copy it onto the real sheet.

Published 2026-11-14 · Translation: VI

What to do first

  • Name the app and the argument separator in the first line of the prompt: Excel or Google Sheets, comma or semicolon.
  • Build a five-row sample on a copy of the sheet, with the answers written down before you ask.
  • Paste the formula only on that sample. Copy it to the real tab after every sample cell matches.

A formula from a chat looks finished. It has the right function names, a short explanation, and no obvious typo. It can still be the wrong dialect: a Google Sheets function in Excel, commas in a spreadsheet that expects semicolons, or a blank cell that quietly becomes zero. The model is guessing a spreadsheet it cannot see.

This check is short on purpose. You spend five minutes on a fake table with known answers. You do not spend an afternoon explaining a live payroll sheet to a chatbot, and you do not discover the mistake after the numbers have been emailed.

Say which spreadsheet you are in

Excel and Google Sheets share a lot of names (IF, SUMIFS, XLOOKUP, FILTER) and disagree on others. QUERY and ARRAYFORMULA belong to Sheets. An Excel Table reference such as Sales[Amount] belongs to Excel. If you do not say which app you have open, the model picks the one from its last example.

The argument separator is a second choice, and it follows the spreadsheet’s locale, not the language of the chat. A sheet set to United States uses commas:

=IF(B2="", "", B2*C2)

A sheet set to Vietnam, Germany, France, and many other locales uses semicolons, and often a comma as the decimal mark:

=IF(B2=""; ""; B2*C2)

Paste the comma version into a semicolon sheet and the cell shows the formula as text, or a parse error. The model will then “fix” it by adding quotes or by switching apps. Tell it the separator up front.

Four cards: Excel with commas, Excel with semicolons, Sheets with commas, Sheets with semicolons. QUERY stays on the Sheets cards only.

Open the spreadsheet’s settings and read the locale before you write the prompt. The chat window will not tell you.

A prompt that starts with those two facts:

Spreadsheet: Google Sheets
Argument separator: comma
Decimal mark: dot
Do not use Excel table references.

I will fill the formula down from D2.
Return the formula only, then one sentence on what changes when I fill down.

Swap in Excel and semicolon when that is what you have. Ask for one formula, not a tutorial.

Build five rows whose answers you already know

The sample is a small tab named SAMPLE, or a copied file. It is not the sheet other people are editing. Put in the awkward rows on purpose. A formula that works on a clean column of 100, 200, 300 has not been tested.

Use a commission column as the worked example. You calculate column E yourself, with a calculator, before the model speaks.

Row A Name B Sales C Rate E Expected
2 An 100 0.1 10
3 Binh 0 0.1 0
4 Chi (blank) 0.1 blank
5 Dung the text 50 0.1 a visible flag, not 5
6 Em 80 (blank) a visible flag, not 0

Row 3 is a real zero: this person sold nothing, and the commission is zero. Row 4 is a missing sale: the cell was never filled, and a commission of zero would be a lie. Spreadsheets treat those two cases differently only if the formula asks them to. =B2*C2 turns the blank into 0.

Row 5 is text that looks like a number. Google Sheets usually returns #VALUE! when you multiply text by a number. Excel often coerces that text and shows 5, so the bad cell looks successful. ISNUMBER makes both apps refuse it. Row 6 is a missing rate, which should not become a zero commission either.

You want D2, filled down:

=IF(OR(B2="", C2=""), "", IF(OR(NOT(ISNUMBER(B2)), NOT(ISNUMBER(C2))), "not a number", B2*C2))

On a semicolon sheet, replace each comma between arguments with ;. The model can produce this formula. Your job is to prove it on the five rows, including the blank and the text.

Keep real salaries, customer lists, and unreleased prices out of a consumer chat. Five invented rows are enough. The same habit as meeting notes: the model needs the shape of the problem, not the private table.

Match the sample, then copy

Put the formula in D2 only. Fill it down to D6. Read D against E, cell by cell. A match means the value and the blankness. Zero is not a match for a blank.

Check loop: five-row sample, paste one formula, compare to answers you calculated. Matching cells go onto the real sheet. Any miss changes one thing and asks again.

If the model’s paragraph says “blanks stay blank” and D4 shows 0, believe D4.

When a cell misses:

  1. Say which address failed, what you expected, and what appeared. “D4 shows 0. Expected blank because B4 is empty.”
  2. Ask for one change. A new formula that also rewrites the rows that already passed is how a fix breaks An’s 10.
  3. Paste the new formula on the sample again, from D2 downward. Do not “patch” D4 by hand and leave D2 old.

Two misses in a row means stop and shrink the request. “Blank stays blank, text returns the words not a number, otherwise multiply” is one job. A second job (tax brackets, currency conversion, a locked rate in $C$2) waits until the first formula is boringly correct.

The rate-in-one-cell case is the usual second job. If every row should use the rate in C2, the reference has to be $C$2. Fill down without the dollar signs and C2 becomes C3, C4, C5. Row 2 still looks right, which is why the sample needs a row where the shifted reference would grab the wrong cell. Put a decoy 0.5 in C3. If D3 suddenly uses 0.5, the dollars were missing.

Only after D2:D6 match E2:E6 do you copy the formula to the real tab. Paste it at the top of the real column and fill down there. Spot-check three real rows: one ordinary, one blank, one that looks like text. Sorting, filters, and merged cells are not on the sample, so those three rows are the extra look.

Four failures that still look finished

The sample catches the failures below. Knowing the name of each one tells you what to ask for next, instead of “this is wrong, try again.”

Trap board: #NAME? means the function is for the other app; a formula sitting as text means the separator is wrong; row 2 right and row 10 wrong means a missing dollar sign; 14/11 read as November means the date is text or the locale swapped day and month.

Each card is a different question for the model. Sending “fix it” without the card sends you back into the same formula.

#NAME?. The function is not in this app. QUERY in Excel does this. So does a named range the model invented (CommissionRate, Table1) when you never created that name. Reply with the exact error and “use only functions that exist in the app I named.” Delete invented names from the formula. Do not go create the name just to make the formula run.

The formula sits in the cell as text. The separator is wrong, or the cell was formatted as text before you pasted. A leading apostrophe does the same thing. Set the cell format to General, confirm comma versus semicolon, and paste again. A formula that does not start calculating has not passed the sample.

Row 2 is right and a later row is wrong. Relative references moved. This is the missing $, or a range that was B2:B6 and became B3:B7 when filled down. Lock the cells that must stay put. Check the last row of the sample, not only the first.

A date or a number changed identity. 14/11/2026 is 14 November in a day-first locale and an invalid or November-14 date in a month-first locale. Text that looks like a date will not sort or subtract as a date. DATE(2026, 11, 14) is unambiguous in both apps. For numbers, prefer ISNUMBER over hoping the app coerces text. A green triangle or a leading apostrophe in Excel means the value is text even when it looks numeric.

A few more errors, for when the cell shows a code instead of a wrong number:

Code What it usually means What to change
#VALUE! A math operator met text ISNUMBER check, or VALUE only when you intend to convert
#DIV/0! Denominator is blank or zero A branch for that case, written on the sample
#N/A Lookup found nothing Decide the fallback ("" or "missing") and add a sample row that should miss
#REF! A range points at a deleted cell Rebuild the reference; do not let the model guess the old address
#ERROR! Sheets could not parse the formula Separator, quotes, or a mismatched parenthesis

Whole-column references (A:A) inside ARRAYFORMULA, QUERY, or an Excel dynamic array are a different kind of miss: the sample is correct and the real file crawls. Point the formula at the used rows (A2:A500) unless you have a reason to scan a million blanks.

What to keep for the next formula

Save the prompt skeleton, not the model’s essay. The skeleton is the app, the separator, the decimal mark, and the sentence “return the formula only.” The essay goes stale the moment the formula changes.

When a formula passes, write one line above the real column or in a note: what D means, and the sample rule (“blank stays blank, text is flagged”). The next person, or the next chat, should not have to rediscover it. For a cleanup that is mostly columns and types rather than one formula, the data cleanup skill is the closer checklist. When the job is really a query over many tables, a sheet formula is the wrong tool; SQL review is the other path. The spreadsheet and data analysis ranking is about which product to open for analysis, not about trusting a single formula.

Watch-outs

  • The explanation can describe a formula you were not given. Compare the formula text with the sample cells. Ignore the paragraph until the cells match.
  • Merged cells break fill-down and lookups. Unmerge on the sample. A formula that needs a merge is a layout, and layouts belong in the sheet, not in the expression.
  • Copied chat formulas pick up fancy quotes. If the cell will not parse, retype the quotation marks. Curly quotes from a chat are not spreadsheet quotes.
  • A formula can be right on the sample and wrong on the live sheet because the live sheet has duplicates, hidden rows, or filters. The three-row spot check is the minimum after you paste.
  • Do not ask the model to “audit the whole workbook” in one reply. One formula, one sample, one pass. A workbook audit is a list of those passes.

Share

X Facebook LinkedIn
Educational content only. Rankings reflect stated criteria at the update date—not investment advice or permanent performance guarantees.