How do you validate an Excel formula written by AI?

A person uses a calculator beside a laptop spreadsheet and a printed table.

Key points

  1. Define the inputs, inclusion rules and treatment of blanks, zero values and exceptions before checking the formula.
  2. Use independently worked normal and boundary cases, rather than letting AI provide the formula and its only answer key.
  3. Check references after copying, then record the approved purpose, version and reviewer.

What should you check first in an AI-written formula?

Check the calculation rule before the formula syntax. Write one plain-language sentence saying which values should be calculated, how and under what conditions. List exclusions as well. A formula can return a number while using the wrong month, threshold or denominator. Microsoft’s formula error guidance also says that error-checking rules do not guarantee an error-free worksheet.

Work in a copy of the workbook and retain the original. Record the purpose, input range, responsible person and expected output alongside the calculation, so a colleague can see what it was designed to answer. For payroll, customer quotations or formal reporting, ask the person responsible for that process to review the result separately. An explanation from AI is not approval to use it.

How do you turn a request into a testable rule?

Resolve ambiguous conditions first. For a monthly total, decide whether to use the order date or completion date, whether cancelled items are excluded, and how to classify records around month-end across time zones. Do not choose whichever interpretation seems convenient after seeing the result.

  • Inputs: define column meanings, units, permitted data types and worksheet names.
  • Conditions: state whether boundary dates, equal values and special statuses are included.
  • Output: specify a total, average or ratio, and the stage at which rounding should happen.
  • Exceptions: decide what to show when the denominator is zero, nothing matches or information is incomplete.

Ask AI to restate these rules and identify unanswered questions before supplying a formula and explaining its references. This gives you a practical requirements check; it does not guarantee that the model will follow every instruction.

A hand marks a tick beside a printed table with a blue pencil, with a calculator and laptop in the background.

Which examples should you test beyond the normal case?

Write the expected answers independently before applying the formula. Consider this hypothetical teaching example, not a company price or a completed test: the unit price is 10, with a 10% discount on the whole amount when quantity reaches 10. The expected totals are 90 for nine units, 90 for ten units and 99 for eleven units. These cases help reveal whether “at least” has been implemented as “more than”.

  1. Normal case: use simple values that you can calculate independently.
  2. Boundary cases: test values just below, exactly at and just above the threshold.
  3. Exceptions: include blanks, zero, negative values or no matching record, defining the correct business response first.
  4. Combined conditions: activate several conditions together to check their priority.

Record inputs, expected values, actual values and differences on separate rows. Asking a second AI the same question can provide another suggestion, but agreement between two answers does not replace independent arithmetic or an informed reviewer.

What can Excel’s built-in tools help you inspect?

Use the tools to inspect intermediate steps against your written rule. Microsoft’s Evaluate Formula guidance explains how to examine a nested calculation step by step. Check availability and menu locations for your actual Excel version. The tool can help locate a divergence, but it cannot decide whether the company’s calculation policy is correct.

Follow the data through the formula: which column supplies the condition, whether the first and last records are included, and whether the denominator contains excluded items. Temporarily splitting a long formula into helper columns can make review easier than reading every bracket at once. If the tool is unavailable, compare simple intermediate calculations in separate columns rather than skipping validation.

Does a correct first cell mean the whole column is safe?

No. Check the references after copying. Microsoft’s reference guidance explains that relative references change when a formula is copied, while absolute references keep a specified position fixed. Decide which parameters should stay fixed and which records should change from row to row.

In your test copy, inspect the beginning, middle and final row, as well as newly added records. Reconcile the overall output using an independent approach, such as adding reviewed category subtotals and comparing them with the grand total. Reusing the same incorrect range in a second formula is not an independent check. Matching totals can also hide errors that cancel each other out, so retain row-level checks.

When is the formula ready for colleagues to use?

Have the responsible person review the test record, permitted uses and unresolved exceptions before introducing the formula into routine work. Keep a short approval record containing the rule version, formula location, test cases, reviewer and date. “No error message” should not be the only acceptance criterion.

Repeat the same examples whenever columns, thresholds, source data structures or formulas change, adding cases for new situations. Retain a human approval step and a recoverable previous version for high-impact outputs. Begin with one clearly bounded calculation that is easy to review, establish the validation process, then consider expanding the role of AI in spreadsheet work.

Frequently asked questions

Does the absence of a green warning mean the formula is correct?

No. Microsoft states that error-checking rules cannot guarantee an error-free worksheet. Compare the calculation with the business rule and independently worked answers, especially its conditions and ranges.

Is asking AI to explain its own formula enough?

No. Its explanation can help you understand the proposed approach, but you still need independent examples and someone who understands the business process. Do not use the same unverified assumption as both the formula and its acceptance test.

What is the minimum number of rows to test?

There is no universal number. Cover every condition, boundary and exception first, then expand the checks according to the variation in your data and the consequences of an error. A handful of rows is not sufficient approval for every high-risk use.

Can Evaluate Formula prove the whole worksheet is correct?

No. Microsoft describes it as a way to inspect a calculation step by step, not a business acceptance test for the workbook. You still need to test different inputs, reference ranges and totals.

Why check again after copying a formula down one row?

Relative references adjust with the copy location. Fixed parameters and row-specific inputs therefore need different treatment. Use Microsoft’s reference guidance to check the intended behaviour rather than fixing every reference indiscriminately.

Can I give AI real customer data to debug the formula?

Prefer a fictional example that preserves the relevant column structure. Avoid submitting names, contact details or other unnecessary information. If real data is genuinely needed, follow the company’s approved tools, access permissions and data-handling requirements first.

About the author: This article was written by the HKONE team. HKONE is a Hong Kong digital marketing and AI automation company providing social media management, website design, AI customer service and GEO / SEO for SMEs. Where this article mentions platform fees or policies, the platform's official information takes precedence.

Tell us about your business first. Then decide.

The consultation is free. We will understand your situation before recommending a plan and a quote.