Quick answer
Test an AI-generated formula in a separate spreadsheet using fictional data. Write down the expected answers yourself, then compare them with the formula’s results. Include ordinary values, blanks, zero, and values just below, at and above any cutoff. Check the cell references again after copying the formula down. A sensible-looking number is not proof that the formula follows your rule.
You do not need to understand every spreadsheet function to start checking a suggested formula. You do need a clear description of what it should calculate—and examples whose answers you can work out independently.
This guide uses a fictional stationery inventory. The formulas are documentation-based illustrations, not a report of hands-on software testing.
1. Write the rule before checking the formula
Imagine you want to calculate how many stationery items to order.
Use this rule:
Order enough units to reach the target stock. If current stock already meets or exceeds the target, order zero. If either input is missing or nonnumeric, display “Check input.”
For this exercise, current stock and target stock must be nonnegative whole numbers. Both columns count individual items, not boxes or packs.
That description settles several questions an AI might otherwise guess:
- Does “target” mean the desired final stock or the quantity to purchase?
- Should excess stock produce a negative order?
- Does a blank mean zero, or does it mean information is missing?
- Are the quantities measured in the same units?
Create a new practice spreadsheet rather than experimenting in an important file. Use invented item names and quantities; there is no need to upload a real inventory to an AI tool.
Before looking at the suggested formula, calculate one answer: with 12 pencils and a target of 20, the order should be 8 pencils.
2. Check the app, version and formula syntax
First identify where the formula must work: Excel for Microsoft 365, Excel 2024, another Excel version, or Google Sheets.
Then check each function against that product’s official documentation. Google notes that Sheets cannot use every function from other spreadsheet programs. Microsoft’s function documentation identifies the Excel versions to which it applies. Similar-looking spreadsheet applications are not a guarantee of compatibility. (support.google.com)
Documentation checked: October 26, 2026. The example below uses IF, AND, ISNUMBER and MAX, which appear in the official documentation consulted for Excel and Google Sheets. It uses English function names and comma-separated arguments. (support.microsoft.com)
An argument is an input supplied to a function. In MAX(0,C2-B2), the two arguments are zero and the subtraction result.
If Excel rejects a pasted formula, check its argument separator. Depending on operating-system locale and Excel settings, the separator may be a comma or semicolon. In Google Sheets, check File → Settings for locale and function-language settings; locale affects default number, currency and date formatting. (support.microsoft.com)
Do not change a shared spreadsheet’s settings casually. Instead, compare the suggested formula with a working formula in that file and consult the relevant documentation.
3. Read the cell references and ranges
A cell reference identifies a location. B2 means column B, row 2. A range identifies a group of cells: B2:B9 includes both endpoints and every cell between them. (support.microsoft.com)
For the practice inventory, use these columns:
| Column | Heading |
|---|---|
| A | Item |
| B | Current stock |
| C | Target stock |
| D | Order quantity |
A formula in D2 should therefore read its inputs from B2 and C2—not the headings in row 1 or another item’s row.
Also check dollar signs:
| Reference | What happens when copied |
|---|---|
B2 |
Row and column can adjust |
$B$2 |
Row and column stay fixed |
$B2 |
Column stays fixed; row can adjust |
B$2 |
Row stays fixed; column can adjust |
These are relative, absolute and mixed references. Dollar signs control what stays fixed when a formula is copied; they do not indicate currency in this context. (support.microsoft.com)
For this inventory, B2 and C2 should change to B3 and C3 when copied down one row. If every row still refers to $B$2, every item could use the pencil quantity.
For formulas involving ranges, inspect both endpoints. Ask whether the range includes the first item, the last item, headings or an unwanted total row.
4. Test the formula with a fictional inventory
Follow this numbered workflow.
1. Enter the headings above in A1:D1.
2. Enter the following data in A2:C9. Where the table says leave empty, leave the actual spreadsheet cell empty; do not type those words.
| Row | Item | B: Current stock | C: Target stock | Expected D result | Manual reasoning |
|---|---|---|---|---|---|
| 2 | Pencils | 12 | 20 | 8 | 20 − 12 = 8 |
| 3 | Pens | 20 | 20 | 0 | Already at target |
| 4 | Erasers | 25 | 20 | 0 | Already above target |
| 5 | Rulers | 0 | 10 | 10 | 10 − 0 = 10 |
| 6 | Paper clips | 19 | 20 | 1 | One below target |
| 7 | Markers | 21 | 20 | 0 | One above target |
| 8 | Notebooks | leave empty | 20 | Check input | Current stock is unknown |
| 9 | Glue sticks | 5 | leave empty | Check input | Target stock is unknown |
3. Write the expected results somewhere separate. Do this before entering the formula so that its output does not become your answer key.
4. Enter this candidate formula in D2:
=IF(AND(ISNUMBER(B2),ISNUMBER(C2)),MAX(0,C2-B2),"Check input")
Read it in three pieces:
ISNUMBERchecks whether each input is numeric.ANDrequires both checks to be true.IFreturns the calculated order when both inputs are numeric, or the warning otherwise.MAXselects the larger of zero and target minus current stock. (support.microsoft.com)
5. Compare D2 with your manual answer. For pencils, 20−12 gives 8, and the larger of 0 and 8 is 8.
6. Copy D2 down through D9. Compare every result with the expected-results table.
For erasers, 20−25 gives −5, so the intended order is zero. The formula’s zero floor implements that rule.
These are expected results derived from the stated rule and documented function behavior. Run the checks in your own spreadsheet before relying on the formula.
5. Challenge blanks, cutoffs and invalid inputs
The inventory tests three useful categories:
- Normal cases: an ordinary shortage or surplus.
- Boundary cases: zero stock and quantities just below, exactly at and just above the target.
- Missing inputs: a blank in either required column.
Now make a few temporary changes in the practice sheet.
Try a number stored as text. In B2, enter '12 with a leading apostrophe. Although it can look like a number, ISNUMBER distinguishes numeric values from numeric text. This candidate should display “Check input”; restore a numeric 12 afterward. (support.google.com)
Try zero in both input cells. With current stock 0 and target 0, the expected order is 0—not a missing-input warning.
Check the formula’s limits. The numeric check does not enforce the exercise’s requirement for nonnegative whole numbers. A negative quantity or decimal can still be numeric. Reject those inputs during review, or add separately tested input-validation rules before using the sheet for whole-item inventory.
Independent-thinking exercise: Suppose an AI suggests:
=ABS(C2-B2)
For pencils, it gives the expected 8. But for erasers, it gives 5 rather than zero. That one correct result did not establish that the formula followed the ordering rule.
The lesson is practical: choose tests that could expose a mistake, not just tests likely to confirm the first answer.
6. Investigate error messages without hiding them
An error message is a clue. These common Excel examples provide a starting point; wording and available troubleshooting tools can differ by application. (support.microsoft.com)
| Message | What to investigate first |
|---|---|
#NAME? |
Misspelled or unrecognized function or name |
#REF! |
An invalid reference, possibly after deleting cells |
#VALUE! |
An input of the wrong type, such as unsuitable text |
#DIV/0! |
Division by zero or an empty divisor |
#N/A |
An unavailable value, often a missing lookup match |
These are common causes, not complete diagnoses. Follow the error to the input or reference responsible. (support.microsoft.com)
If Excel displays the formula itself instead of a result, check whether formula display is enabled or the cell is formatted as text. For a text-formatted formula cell, Microsoft documents changing it to General and re-entering the formula. (support.microsoft.com)
Avoid immediately wrapping an unexplained formula in IFERROR(...,0). IFERROR replaces an error with a chosen output; that replacement does not repair the underlying problem. In this inventory, zero means “order nothing,” so using it to hide an error could conceal missing information. (support.google.com)
If a formula is difficult to follow, temporarily calculate its parts in separate cells. Excel for Windows also provides Formulas → Formula Auditing → Evaluate Formula for inspecting a calculation step by step. (support.microsoft.com)
7. Check copied rows and approve only what you tested
Before moving beyond the practice sheet, use this checklist:
- The written rule explains blanks, zero, equality and excess stock.
- The functions are documented for the intended spreadsheet application.
- References point to the correct columns and rows.
- Copied formulas use each item’s own inputs.
- Ordinary, blank and boundary tests match independently calculated answers.
- Invalid inputs are rejected or clearly identified for correction.
- Ranges include all intended rows.
- No unexplained error has been replaced with a reassuring zero.
Inspect the formula bar in the first, middle and final copied rows. In D9, this example should refer to B9 and C9.
If you add another item below row 9, check both its formula and any summary range. Microsoft notes that formulas can omit cells from a region; do not assume an existing total includes newly added data. (support.microsoft.com)
Finally, keep a short record of the formula, rule, application and test cases. Passing these checks supports using it for the conditions examined—not a promise that it handles every future layout or input. Recheck after changing columns, units, targets or spreadsheet software.
Read next: How AI Chatbots Generate Answers—and Why They Can Be Wrong