Start practice

Excel formula not working

AI for Excel ·

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:

  1. Is it the right function? One condition: SUMIF or COUNTIF. Two or more: SUMIFS or COUNTIFS. One value from a list: XLOOKUP.
  2. Do the ranges cover all the data? Compare the last row in the formula with the last row of the sheet.
  3. Is every range the right column? The values to add and the condition each have their own column.
  4. Is the condition exact? Spelling, spaces, ">" against ">=".

Examples

All examples use this sheet, data in rows 2 to 9:

RowC RegionD ProductE Amount
2WestLaptop1200
3EastMonitor300
4WestMonitor250
5NorthLaptop1100
6EastLaptop1300
7WestKeyboard80
8NorthMonitor280
9WestLaptop1150

One row short

Formula
=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

Formula
=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.

Formula
=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

SymptomLikely causeFix
Total a little lowRange one row short or starts lateExtend the range to the last row
Result is 0Condition column wrong, or text does not matchPoint at the right column, check spelling and spaces
Count off by a few> instead of >=Match the wording of the goal
Too bigA condition missingUse SUMIFS or COUNTIFS with every condition
SUM ignores some numbersNumbers stored as textConvert the column to numbers
Arguments look swappedSUMIF and SUMIFS order mixed upSUMIFS 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:

Prompt
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.