A spreadsheet formula can look convincing and still answer the wrong question. Before using one suggested by an AI assistant, give it a small test whose result you can calculate without the formula.
Use invented data first. This both simplifies the check and avoids sending private business records to a tool unnecessarily. State the spreadsheet application, the relevant columns and exactly what should be counted or added.
A five-row test with an answer you already know
Imagine column A contains a category and column B contains an amount, with headings in row 1. Enter these five records in rows 2 through 6: Tea 10, Coffee 8, Tea 5, Tea 0 and Coffee 12. The sum for Tea should be 15.
In an English-language Excel configuration using commas, one suitable formula is =SUMIF(A2:A6,"Tea",B2:B6). Microsoft’s SUMIF reference explains the criteria range and optional range to sum. Other language or regional settings may require different separators or function names.
Now change Tea 5 to Tea 7. The expected answer becomes 17. Change that record’s category to Coffee and the Tea total should return to 10. These changes test whether the formula follows both the category and the amount.
Test the mistakes your real sheet could contain
Add a blank amount, a number stored as text or a category with an accidental trailing space. Decide what the business rule should be, then inspect how the formula behaves. Do not silently accept an output merely because it produces no error message.
If the formula will be copied, test the copied version too. Relative references can move to a different range; absolute references keep specified rows or columns fixed. Explain every dollar sign before relying on it.
Keep the small test sheet alongside the working model. When the formula changes, rerun the known examples. The AI can help propose a formula and explain it, but the expected answers should come from your understanding of the task.

