Excel formula not working
A formula that shows an error is easy: you know something is wrong. The hard case is a formula that returns a number that is simply wrong. AI written formulas fail in a small number of typical ways, and once you know them you can find the problem in under a minute.
The quick check
Run through these four questions in order:
- Is it the right function? One condition: SUMIF or COUNTIF. Two or more: SUMIFS or COUNTIFS. One value from a list: XLOOKUP.
- Do the ranges cover all the data? Compare the last row in the formula with the last row of the sheet.
- Is every range the right column? The values to add and the condition each have their own column.
- Is the condition exact? Spelling, spaces, ">" against ">=".
Examples
All examples use this sheet, data in rows 2 to 9:
| Row | C Region | D Product | E Amount |
|---|---|---|---|
| 2 | West | Laptop | 1200 |
| 3 | East | Monitor | 300 |
| 4 | West | Monitor | 250 |
| 5 | North | Laptop | 1100 |
| 6 | East | Laptop | 1300 |
| 7 | West | Keyboard | 80 |
| 8 | North | Monitor | 280 |
| 9 | West | Laptop | 1150 |
One row short
=SUM(E2:E8)
Result: 4,510. The real total is 5,660, because row 9 is left out. This happens when data was added after the formula was written, or the AI guessed the last row. Fix: =SUM(E2:E9) or =SUM(E:E).
Condition range points at the wrong column
=SUMIF(D2:D9,"West",E2:E9)
Result: 0. Column D has products, not regions, so nothing matches. Fix: =SUMIF(C2:C9,"West",E2:E9), which gives 2,680.
More than, or more than or equal
Goal: orders of $1,100 or more.
=COUNTIF(E2:E9,">1100")
Result: 3. The order of exactly 1,100 is left out. Fix: ">=1100" gives 4. "Over", "above" and "more than" mean >; "at least" and "or more" mean >=.
A condition was dropped
Goal: Laptop sales in the West. The AI wrote =SUMIF(C2:C9,"West",E2:E9), which gives 2,680, all West sales. The right formula keeps both conditions: =SUMIFS(E2:E9,C2:C9,"West",D2:D9,"Laptop"), which gives 2,350.
Typical mistakes at a glance
| Symptom | Likely cause | Fix |
|---|---|---|
| Total a little low | Range one row short or starts late | Extend the range to the last row |
| Result is 0 | Condition column wrong, or text does not match | Point at the right column, check spelling and spaces |
| Count off by a few | > instead of >= | Match the wording of the goal |
| Too big | A condition missing | Use SUMIFS or COUNTIFS with every condition |
| SUM ignores some numbers | Numbers stored as text | Convert the column to numbers |
| Arguments look swapped | SUMIF and SUMIFS order mixed up | SUMIFS starts with the range to add |
Error codes
#N/A
A lookup did not find the value. Check for extra spaces or a number stored as text, or add a not found value: =XLOOKUP(H1,A2:A9,E2:E9,"Not found"). See XLOOKUP.
#NAME?
Excel does not know the function name: a typo, or a function your version does not have, like XLOOKUP in older Excel. Ask the AI for an alternative for your version.
#VALUE!
Often the ranges in SUMIFS or COUNTIFS have different sizes, such as E2:E9 and C2:C8. Make every range the same rows.
#REF!
A cell the formula used was deleted. Rewrite the formula with the current ranges.
Variants: ask AI to find the bug
AI is good at explaining why a formula fails, if you give it the facts:
This Excel formula should give the total of column E for region "West" in column C, rows 2 to 9, but it returns 0: =SUMIF(D2:D9,"West",E2:E9). What is wrong? Give the fixed formula.
Include what the formula should do, what it returns and the layout. Then test the fix yourself.
Practice
The level "Check and fix in a minute" has a guided version. You get an AI formula and a goal, find what is wrong (short range, wrong column, missing condition, > against >=) and type the fixed formula. Your fix is checked on the sheet and on changed copies, so only a truly correct formula passes. Before that, it helps to know how to get a formula from AI.
Start step by step: Check and fix in a minute
Free, in your browser, no sign up. Opens level “Check and fix in a minute”.
FAQ
Why does my SUMIF return 0?
Most often the condition range is the wrong column, or the text does not match exactly, for example "West " with a space. Also check that the amounts are numbers, not text.
Why is my formula result slightly wrong?
Check the range first: one missing row at the end is the most common cause. Then check > against >= and that no condition is missing.
How do I check an AI formula?
Read the function, the ranges and the condition against your sheet, then compare the result with one case you can work out by hand.
For learning only. Nothing here is legal, financial or tax advice. Sample AI replies in the practice are written in advance, and all names and numbers are made up.