Before you fill the column: test an AI formula on three rows
Jump to section
You ask AI for a quantity-discount formula. It returns a number, so you fill the whole column. But what happens at exactly 10 items? These three fictional order lines reveal a one-character mistake that an ordinary order can hide. You will leave with a small test sheet and expected answers you can check yourself.
1. Set the rule before asking for a formula
Rule: multiply quantity by unit price. At 10 items or more, take 10% off the entire line total; below 10, apply no discount. Quantities are positive whole numbers and unit prices are positive numbers. This exercise uses whole-number prices in arbitrary units, with no tax, shipping or rounding rule.
Use Google Sheets on a computer. In a separate practice spreadsheet, choose File → Settings → Locale: United States and keep English function names enabled. The examples use IF and commas between arguments. Function language and spreadsheet locale are separate settings; these formulas do not claim to fit every locale. Do not change a shared work sheet just to match this example.
Google’s settings guide explains locale and function-language controls. Its IF documentation explains the two result branches. Sources checked on 19 October 2026. The formulas below are authored examples, not captured AI responses; the arithmetic was checked independently, without a signed-in Sheets session or a model call.
2. Paste the tiny sheet, then add the candidate
Copy the tab-separated block into A1 of the practice sheet. It fills A–C: quantity, unit price, expected total. Column C contains fixed answers, not formulas. If everything lands in one column, split the pasted text using a tab separator before continuing.
Qty Price Expected
12 50 540
10 50 450
9 50 450Type Candidate in D1. Paste this formula into D2, then fill it down only to D4. A2 and B2 are relative references: in D3 they should become A3 and B3, and in D4, A4 and B4.
=IF(A2>=10,A2*B2*90%,A2*B2)A2>=10 includes exactly 10. In that branch, multiplying by 90% leaves the total after a 10% discount. Otherwise, the formula returns quantity × price unchanged. Google documents >= as “greater than or equal to”.
3. Check three known answers, including the boundary
- Row 2 — ordinary qualifying order: 12 × 50 = 600; discount 600 × 10% = 60; expected 600 − 60 = 540. D2 must equal C2: 540.
- Row 3 — exact boundary: 10 × 50 = 500; discount 500 × 10% = 50; expected 500 − 50 = 450. D3 must equal C3: 450.
- Row 4 — just below the boundary: 9 × 50 = 450; no discount; expected 450. D4 must equal C4: 450.
Now type Wrong in E1. Put this deliberately wrong formula in E2 and fill it to E4:
=IF(A2>10,A2*B2*90%,A2*B2)E2:E4 should read 540, 500, 450. Rows 2 and 4 pass; row 3 fails by 50. The > test excludes exactly 10, violating “10 or more”. Both formulas can produce numbers without a formula error. A number alone does not prove that a formula follows the requested business rule. The exact-boundary row exposes the difference.
4. Ask AI for a formula you can challenge
If you use an approved AI tool, this prompt supplies the setup and independent targets. You can also do the whole exercise without AI.
Write a Google Sheets formula for D2.
Locale: United States; English functions; commas.
A = quantity; B = unit price; row 1 = headers.
Positive whole quantities, positive prices.
Rule: quantity * price; at quantity >= 10,
apply 10% off the entire line total.
No tax, shipping or rounding in this example.
Use relative references for filling down.
Known checks (quantity, price => total):
12, 50 => 540
10, 50 => 450
9, 50 => 450
Return the formula and explain each branch.
Show each check, including exactly 10.
Do not alter the rule or expected answers.
State which inputs still need more tests.5. Try your next rule on a non-sensitive sample
Before filling a real column, write your own rule and calculate three expected answers without the generated formula: an ordinary case, the exact threshold and a case on the other side. Run the candidate on that small non-sensitive sample, compare every answer, and inspect the references after filling down. If any answer differs, stop and resolve the mismatch first.
Three passing rows catch this mistake; they do not certify every input. Before broader use, decide what blank cells, zero, negative values, text and decimal prices should do, then test those cases and any required rounding separately. Keep confidential data out of unapproved AI tools.
Karel Čech
Developer and AI consultant. I help technical teams adopt AI in their daily workflow — from workshops to long-term strategies.
LinkedIn →Stay ahead with AI insights
Practical tips on AI for dev teams. No spam, unsubscribe anytime.
Related posts
“Clarify the proposal” is not enough: ask AI for three checkable findings
One proposal, three different problems: conflicting deadlines, a wrong total and an untested assumption. Learn to ask for exact evidence and questions you can resolve.
Turn a long project update into a note your manager can act on
A complete fictional update, a short decision note and a fact trace: keep the choice, recommendation, owners and deadline visible.
AI gave you a vague plan? Turn your task brief into a usable prompt
Separate facts from missing decisions, then ask for a plan you can check. Copy a complete library-workshop prompt and adapt the worksheet to your next office task.