logo
search
Formula Errors

How to Fix Excel IF Formula Returning FALSE When Comparing 120

WPS EditorWPS Editor Oct 1, 2026 869 views

Question details

The IF formula unexpectedly returns FALSE when checking if a cell equals the number 120, caused by a mismatch between numeric and text data types.

How to Fix Excel IF Formula Returning FALSE When Comparing 120
Product
Excel
Device & OS
not provided
Scenario
Writing an IF function to run a logical test comparing a cell's contents to a specific value (120).
Observed behavior
The formula evaluates to FALSE even when the cell visually contains the target number, because Excel is treating the reference cell as text while the formula is checking for a numeric value.
Before you start

Check the data format of the cell you are comparing to see if the value '120' is stored as a standard numeric value or as a text string.

Solution 1Recommended

Use standard numeric comparison without quotation marks

Apply this solution when the target cell contains a true numeric value.

In Excel, numbers are recognized natively by the calculation engine. If the cell you are referencing contains a number, your formula should not contain quotation marks around that number.

1
Select the destination cell

Click on the empty cell where you want the result of your IF formula to appear.

2
Enter the numeric IF formula

Type the formula =IF(O2=120, "yes", "no") into the formula bar at the top of the screen.

3
Apply the formula

Press the Enter key. Because 120 is entered without quotation marks, Excel will successfully match it against a numeric cell.

Use standard numeric comparison without quotation marks
Proper Syntax: Always remember that only the text outputs (like "yes" and "no") require quotation marks in this scenario.
WPS Spreadsheet Solution

Write and Troubleshoot IF Formulas Easily with WPS Office

WPS Spreadsheet provides an intuitive formula builder and smart error checking tools. It automatically highlights numbers stored as text so you know exactly which IF formula syntax to use without second-guessing.

  1. 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open your spreadsheet document.
  2. 2. Check the cell format: Look at the target cell (e.g., O2). If there is a small green triangle in the top-left corner, it indicates the number is stored as text.
  3. 3. Enter your formula: Click your result cell and type =IF(O2=120,"yes","no") for numbers, or =IF(O2="120","yes","no") if it is formatted as text.
  4. 4. Press Enter to calculate: Hit Enter on your keyboard to instantly run the logical calculation.
Fully compatible with Microsoft Excel (.xlsx) files and standard IF functions.Smart error checking quickly flags numbers stored as text with a visible green triangle.Free, lightweight, and features a familiar user interface for a seamless transition.
microsoft office alternative - wps office

Frequently Asked Questions

Why are quotation marks required for text but not numbers in Excel?

Excel relies on quotation marks to identify literal text strings. If you omit quotation marks around text, Excel interprets the word as a cell reference or a defined name, which usually results in a #NAME? error. Numbers are naturally recognized as values, so quotes aren't needed unless you specifically want them treated as text.

How do I convert a number stored as text back to a normal number?

Select the cells containing the text-formatted numbers (usually marked with a green triangle). Click the warning icon that appears next to the selection and choose 'Convert to Number' from the dropdown menu.

Can I make the IF function ignore whether a number is formatted as text?

Yes, you can use the VALUE function inside your IF formula to force a text number into a true numerical value. For example, the formula =IF(VALUE(O2)=120, "yes", "no") will evaluate correctly regardless of whether O2 is stored as text or a number.