The agent that writes the formula never opens the file it just built, so it has no way to know whether the number that formula produces is actually correct. The fix is to give the agent a way to calculate the result itself and compare it to what the formula returns, before the file counts as done, instead of asking it for a more careful formula.
The reason sits in how a language model generates text: it writes the formula character by character, based on how similar formulas looked across millions of files it has seen, not by actually running the calculation. That works fine for a simple formula, and breaks down exactly where cells depend on each other, a range shifts, or a condition nests inside another, because that is where the gap between a formula that looks right and a formula that computes right grows. The rule that follows is simple: any output the agent cannot read back as text, like a spreadsheet, a slide, or an image, is an output it wrote blind, and the check has to happen in a different tool, not in the agent's own judgment of what it wrote.
Our own rule is that any file with formulas goes back to the agent a second time, for three or four key cells it calculates itself, step by step, comparing them against the result we expected (only the cells with the most tangled dependencies, not the whole sheet). When we built an internal pricing table a few weeks ago, the formula looked perfect on a quick read, and once the agent actually calculated the result itself instead of trusting the syntax it had written, one number was off, which was exactly enough to catch a range that started one cell too late.
It sounds like an extra step, until you remember a spreadsheet is basically the one output the agent builds without ever truly seeing it, which makes it the most confident student in the room (and also the only one who never opens the notebook before handing it in).
A prompt, on the house
I have an Excel file with formulas. Before you say you are done:
1. Pick the 3-4 cells with the most complex formulas in the file.
2. Calculate the result of each one yourself, step by step, without
relying on the syntax you wrote.
3. Compare it to what the formula actually returns, and flag every gap.
4. If even one cell is off, fix it and repeat the process from the start.





