Excel IF Function Not Working? Fix Common Formula Errors

Errors & fixes · Updated November 3, 2026

Excel IF Function Not Working? Fix Common Formula Errors

If Excel’s IF function is not working, first check that the formula starts with =IF(, its test compares the values you intended, and its commas, quotation marks, and parentheses are in place. Then check whether the cell contains numbers stored as text, whether calculation is set to Automatic, and whether Excel is displaying the formula instead of its result.

IF makes a decision: it tests a condition and returns one value when the condition is true and another when it is false. A small difference in a cell’s contents or formula syntax can change the result, so the best fix is to inspect the test and the underlying data rather than replace the function immediately.

How the IF function works

IF has three parts: a logical test, the value to return if that test is true, and the value to return if it is false. The last part is optional; if it is omitted and the test is false, Excel returns FALSE. The test can compare numbers, text, dates, or the result of another function.

With a student’s score in A2, this formula returns Pass for a score of 60 or more and Fail for a lower score. It assumes A2 contains the score 72, so the result is Pass: =IF(A2>=60,"Pass","Fail")

Comparison operators matter. Use >= for “greater than or equal to,” > for “greater than,” < for “less than,” and <> for “not equal to.” A test using >60 does not treat exactly 60 as a pass, while >=60 does.

Check the formula’s syntax

A missing parenthesis, an extra argument, or quotation marks in the wrong place can stop a formula from working. Text values returned by IF need straight double quotation marks. Cell references and numbers do not: write A2, not “A2,” when you want Excel to check the cell.

With a payment status in A2, this formula returns Complete if the cell contains the text Paid, and Check otherwise. If A2 contains Paid, the result is Complete: =IF(A2="Paid","Complete","Check")

Text comparisons are generally case-insensitive in Excel, so “Paid” and “PAID” normally match. Extra spaces are different: a cell containing Paid (with a trailing space) may not match Paid. Also check whether the formula’s opening parenthesis has a matching closing parenthesis and whether each argument is separated correctly.

Excel normally uses commas between arguments in Microsoft 365 for Windows when the regional settings expect commas. Some regional configurations use semicolons instead. If Excel rejects a formula that otherwise looks correct, check which list separator your installation expects; the examples here use commas.

Check what is actually in the cells

A value can look right on the sheet but have a different underlying value. Common causes include a number stored as text, an unexpected space, or a date that Excel is treating as text. Click the cell and inspect its contents in the formula bar. You can also test the formula using a known, simple value in a spare cell to distinguish a formula problem from a data problem.

For a text test, compare the contents precisely. If A2 is supposed to contain Paid, but the result says Check, remove accidental spaces or standardize the source data. With the text in A2, this version trims leading and trailing spaces before comparing; if A2 contains Paid , it returns Complete: =IF(TRIM(A2)="Paid","Complete","Check")

Numbers stored as text can cause unexpected comparisons. For example, a text value “72” may not behave like the numeric value 72 in every calculation. A green warning indicator may offer a Convert to Number option. Another option is to correct the source data or use an appropriate conversion, after confirming that the cell really contains a number and not an identifier such as a postal code.

Blank checks need care too. A cell that looks empty may contain a space or a formula returning an empty string. With a value in A2, this formula returns Missing if A2 is blank or evaluates to an empty string; otherwise it returns Entered: =IF(A2="","Missing","Entered"). If spaces should count as blank, clean the data or apply TRIM as part of the test.

Understand common errors and unexpected results

If Excel shows #NAME?, check for a misspelled function name, unquoted text, or a name that Excel does not recognize. For example, entering Paid without quotation marks makes Excel try to interpret Paid as a defined name. If the formula displays #VALUE! or another error, inspect the cells and functions used by the logical test; IF does not automatically repair errors inside that test.

A result of FALSE is not necessarily a broken formula. It often means the logical test evaluated as false and the formula did not provide a third argument. Add the value you want for the false case. Conversely, if the formula always returns the true result, check whether the test is too broad, references the wrong cell, or compares values that are not the same kind of data.

When a formula refers to a deleted cell, Excel may show #REF!. Edit the reference to point to the intended cell or restore the missing data. Wrapping a formula in IFERROR can replace an error with a chosen fallback, but it can also conceal a real problem. Use it only when that fallback is meaningful, not simply to hide an error you have not diagnosed.

With a numerator in A2 and a denominator in B2, this formula returns the division result or 0 if the calculation produces an error. If A2 is 10 and B2 is 0, it returns 0; that may be appropriate for some reports, but it can also hide a zero-denominator issue: =IFERROR(A2/B2,0)

Fix formulas that show as text or do not update

If you can see =IF(...) in the cell instead of a result, first check whether Show Formulas is on. In Excel for Microsoft 365 on Windows, choose Formulas > Show Formulas to toggle the view. The Windows shortcut is Ctrl+` (the grave-accent key, usually beside 1). On Mac, the shortcut can depend on the keyboard layout; use Formulas > Show Formulas if the shortcut is unavailable.

If only one cell shows its formula, the cell may be formatted as Text, or the formula may have a leading apostrophe. Change the number format to General or another suitable format, then edit the cell and press Enter so Excel reinterprets the entry. Merely changing the format may not convert an existing text entry into a formula.

If the formula is valid but its result remains out of date, check calculation mode. In Excel for Microsoft 365 on Windows, choose Formulas > Calculation Options > Automatic. In Manual mode, Excel may wait for a recalculation command. Press F9 to calculate; on some Mac keyboards, you may need Fn+F9. Calculation mode can affect other open workbooks too, so consider the impact before switching it.

Use AND, OR, and nested conditions carefully

IF can test more than one condition by using AND or OR. AND is true only when every condition is true; OR is true when at least one is true. This is useful for eligibility rules, quality checks, and other decisions with multiple requirements.

With attendance as a proportion in B2 and a test score in C2, this formula returns Eligible only when attendance is at least 90% and the score is at least 70. If B2 is 0.92 and C2 is 75, the result is Eligible: =IF(AND(B2>=0.9,C2>=70),"Eligible","Review")

Nested IF functions make a decision inside another decision, but they can be difficult to read and maintain. For a few categories, they may be adequate; for many thresholds, a lookup table or IFS can be clearer. IFS is available in Excel 2019 and later, including Microsoft 365. Whatever approach you use, order threshold tests carefully: a broad test placed before a narrower one may capture values you intended to classify differently.

A practical troubleshooting sequence

Work through these checks in order, changing one thing at a time. That makes it easier to identify the actual cause rather than introducing a second problem while editing the formula.

  1. Click the cell and confirm that the entry begins with an equals sign and the function is spelled IF.
  2. Check every cell reference in the logical test, then verify whether the comparison operator includes the boundary you want.
  3. Check quotation marks around text, parentheses, and argument separators. Confirm whether your Excel installation expects commas or semicolons.
  4. Inspect the source values for spaces, numbers stored as text, dates stored as text, and formulas that return an empty string.
  5. Check for a leading apostrophe, Text cell formatting, or Show Formulas being enabled if the formula itself appears in the grid.
  6. Set calculation to Automatic or recalculate if the formula is correct but its result is stale.
  7. Test a short formula against a known value in a spare cell, then restore the original formula once you know whether the issue is syntax or source data.

When another Excel feature is a better fit

IF returns a value in a cell; it does not merely change the cell’s appearance. If the goal is to color cells that meet a rule while leaving their values unchanged, use Home > Conditional Formatting rather than writing IF just to display a color. Conditional formatting can be based on cell values or a formula, while IF is appropriate when you need a returned label, number, or other result.

For a decision with several outcomes, consider whether a lookup table would be easier to review than a long chain of nested IF functions. A table makes category boundaries visible and can be updated without editing a complicated formula. For a simple two-way decision, however, IF is usually the most direct choice.

Frequently Asked Questions

Why does my Excel IF formula return FALSE?
If you omit the false-result argument, Excel returns FALSE when the test is false. Add the result you want for that case, and check whether the logical test is comparing the intended values.

Why is Excel displaying my IF formula instead of the answer?
Show Formulas may be enabled, or the cell may be formatted as Text or have a leading apostrophe. Turn off Formulas > Show Formulas, then, if needed, change the cell format and re-enter the formula.

Why does IF say two text values are different when they look the same?
One value may contain a leading or trailing space, a nonprinting character, or a different underlying value. Inspect the cell contents and clean or standardize the data before comparing.

Does IF treat an empty cell the same as a formula returning an empty string?
A test such as A2=”” treats a genuinely blank cell and a cell whose formula returns an empty string as empty for that comparison. A cell containing a space is not empty, so trim or clean it if spaces should count as blank.

Why does my IF result not change after I edit a value?
The workbook may be using Manual calculation. Choose Formulas > Calculation Options > Automatic, or recalculate with F9. Also verify that the edited cell is actually one of the cells referenced by the formula.

Can IF return a number instead of text?
Yes. The true and false results can be numbers, text, references, or other formula results. Make sure both outcomes are appropriate for later calculations; a number stored as quoted text may not behave like a numeric value.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Errors & fixes

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.