ExcelyourTraining

Home › Blog

Excel IF Formula Not Working? 6 Common Mistakes and How to Fix Them

Your IF formula looks right. Excel disagrees. Maybe it shows an error, maybe it says FALSE, or maybe it gives an answer that's simply wrong for some rows.

The good news is that most broken IF formulas fail for the same handful of reasons. Work through the six below and you'll be able to spot the problem, fix it, and know how to avoid it next time.

1. You used the ≥ symbol instead of >=

This one often happens when a formula is copied from a Word document, a PDF or a chat message.

What you typed What Excel needs
=IF(B2≥50,"Pass","Fail") =IF(B2>=50,"Pass","Fail")
=IF(C2≠"Paid","Follow up","") =IF(C2<>"Paid","Follow up","")

Excel doesn't recognise the single ≥, ≤ or ≠ characters as operators, so the formula breaks, often with a #NAME? error. Delete the symbol and type the two-character version on your keyboard: >=, <= or <>. The order matters too. Greater-than or less-than comes first, then the equals sign.

2. Your IF formula returns FALSE

You wanted "Fail" or a blank cell, and instead you see the word FALSE. That usually means you left out the third part of the IF.

=IF(B2>=50,"Pass")

When the test is TRUE, this shows "Pass". When it's FALSE, Excel has nothing to show, so it shows FALSE. Add the missing answer:

=IF(B2>=50,"Pass","Fail")

If you want the cell to look empty when the test fails, use two quotation marks with nothing between them:

=IF(B2>=50,"Pass","")

Watch out for a closely related slip. If you keep the comma but leave the space after it empty, like =IF(B2>=50,"Pass",), Excel shows 0 instead of FALSE. Same cause, same fix.

3. Quotation marks in the wrong place

The rule is simple, but it's easy to get backwards: text goes in quotes, numbers don't.

Formula What goes wrong
=IF(C2=Durban,"Local","Out of town") No quotes around Durban. Excel thinks it's a name it should know and gives #NAME?
=IF(B2>="50","Pass","Fail") Quotes around 50 turn it into text. Every real number now fails the test
=IF(C2="Durban",Local,Out of town) The answers are text without quotes, so the formula breaks

The fixed versions:

=IF(C2="Durban","Local","Out of town")

=IF(B2>=50,"Pass","Fail")

The second row is the sneaky one. Excel doesn't show an error. It just gives the wrong answer for every row. When Excel compares a number to text, it treats any text as larger than any number, so 72>="50" is FALSE. If everyone in your list suddenly fails, check for quotes around your cut-off.

4. Your numbers are stored as text

This is the reverse of mistake 3, and it's common with data that came from another system, a website or a CSV download.

Name Sales (R) Formula result
Thandi 18 400 Below target
Pieter 9 750 Target met

The formula is =IF(B2>=15000,"Target met","Below target"). Pieter's R9 750 shouldn't meet a R15 000 target. The problem is that his sales figure was imported as text. Because text counts as larger than any number, his "number" passes every greater-than test.

Signs to look for:

To fix it, select the cells, click the warning icon that appears next to them and choose Convert to Number. Or use a helper column with =VALUE(B3) and point your IF at that instead.

5. Your nested IF checks things in the wrong order

Say the rule is: 75% and above is a Distinction, 50% and above is a Pass, below that is a Fail. Here's a nested IF that looks reasonable:

=IF(B2>=50,"Pass",IF(B2>=75,"Distinction","Fail"))

Mark Expected What this formula shows
88 Distinction Pass
75 Distinction Pass
62 Pass Pass
41 Fail Fail

Nobody ever gets a Distinction. Excel reads a nested IF from left to right and stops at the first test that's TRUE. A mark of 88 is at least 50, so it stops at "Pass" and never reaches the Distinction test.

Put the strictest test first:

=IF(B2>=75,"Distinction",IF(B2>=50,"Pass","Fail"))

The same rule applies to IFS, which is available in Excel 2019 and later, including Microsoft 365: =IFS(B2>=75,"Distinction",B2>=50,"Pass",TRUE,"Fail"). Order the tests from highest to lowest. Microsoft's own guidance warns that conditions in the wrong order are a classic nested IF problem, because the formula still runs and the mistake can go unnoticed.

6. You get #DIV/0! in a calculation

Not strictly an IF problem, but it shows up in the same sheets. Here's a sales summary with average order value per rep:

Rep Total sales (R) Orders Average (R)
Aisha 12 600 9 1 400
Sipho 0 0 #DIV/0!

Sipho was on leave, so the formula =B3/C3 divides by zero. You can catch this with IFERROR:

=IFERROR(B3/C3,"")

IFERROR gives you the normal result when there's no error, and whatever you put in the second part when there is one. Here that's a blank. You could also show "No orders" or 0.

One warning. IFERROR hides every kind of error, not just #DIV/0!. If you mistype a cell reference or a function name, IFERROR will hide that too, and you won't know something's broken. When you know exactly what you're guarding against, a targeted IF is safer:

=IF(C3=0,"",B3/C3)

This only handles the zero case. Any other error still shows up so you can fix it.

A quick checklist for any IF that's not working

  1. Click the cell and read the formula in the formula bar, slowly, like a sentence.
  2. Check the operators are typed with the keyboard: >=, <=, <>.
  3. Text in quotes, numbers without.
  4. Make sure all three parts are there.
  5. Test a value just below, exactly on and just above each cut-off.

Practise the fixes

The fastest way to stop making these mistakes is to make them somewhere safe and see what happens. ExcelyourTraining gives you a real spreadsheet in your browser and checks each answer the moment you press Enter.

It's free, with no sign-up. Try lesson 12 now and fix your next IF before it breaks.