Formula Errors

How to Fix Excel IF Formula for Increase, Decrease, or Equal

John WilsonJohn Wilson Oct 26, 2026 869 views

Question details

The user needs to write a nested IF formula that compares two cells and returns 'Increase', 'Decrease', or 'Equal'. The formula currently returns incorrect results because the numerical values are stored as text.

Product
Spreadsheets
Device & OS
not provided
Scenario
Comparing two data points (like current and previous values) using an IF function to track changes over time.
Observed behavior
The IF formula evaluates the data incorrectly, assigning the wrong trend label because it processes text strings differently than numerical values.
Before you start

Ensure that the cells you are comparing do not contain hidden spaces or special characters, which can interfere with accurate logical comparisons.

Solution 1Recommended

Apply the Nested IF Formula and Fix Number Formatting

Use the standard nested IF structure for the comparison, and utilize the Text to Columns feature to resolve any underlying format inconsistencies.

A nested IF function evaluates multiple conditions in sequence. When comparing numbers, Excel requires the cell format to be numerical. If data was imported from another system, numbers might be stored as text, causing > or < logical tests to fail.

1
Enter the nested IF formula

Click the cell where you want the result to display. Type the formula =IF(B2>C2,"Increase",IF(B2<C2,"Decrease","Equal")) and press Enter.

2
Verify data format using ISTEXT

If the result is incorrect, pick an empty cell and type =ISTEXT(B2). If it returns TRUE, the number is stored as text and needs to be converted.

3
Convert text to numbers

Select the column containing the text-formatted numbers. Navigate to the 'Data' tab on the top ribbon and click 'Text to Columns'.

4
Complete the conversion

In the pop-up wizard, you do not need to change any settings. Simply click 'Finish'. The values will convert to numbers, and your IF formula will instantly update with the correct result.

Apply the Nested IF Formula and Fix Number Formatting
Alignment Indicator: By default, numbers stored as text are aligned to the left side of the cell, whereas actual numerical values are aligned to the right. This visual cue can help you quickly spot formatting issues.

Easily Track Data Changes with WPS Spreadsheet

WPS Spreadsheet offers an intuitive interface for writing nested formulas, complete with smart error checking to help you quickly identify and fix text-stored numbers when analyzing data trends.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing the values you want to compare.
  2. 2. Apply the IF formula: Select the target cell, type =IF(B2>C2,"Increase",IF(B2<C2,"Decrease","Equal")), and press Enter.
  3. 3. Auto-fill the column: Click and hold the small green square at the bottom-right corner of the cell, then drag it down to apply the formula to the rest of your data.
  4. 4. Fix formatting automatically: If you see a small green triangle in the corner of your data cells, click the warning icon next to it and select 'Convert to Number' to instantly fix formula errors.
Built-in smart error indicators easily highlight numbers stored as text.100% compatible with Microsoft Excel formulas, functions, and .xlsx file formats.Free, lightweight, and fast alternative for all your data analysis needs.
microsoft office alternative - wps office

Frequently Asked Questions

Is there a faster way to convert text to numbers without using Text to Columns?

Yes. You can type the number 1 in any empty cell, copy it, select all your text-formatted numbers, right-click, choose 'Paste Special', select 'Multiply' in the operation section, and click OK.

Can I add the actual difference amount to the Increase or Decrease text?

Yes, you can use the ampersand (&) operator to combine text and calculations. For example: =IF(B2>C2, "Increase by " & (B2-C2), IF(B2<C2, "Decrease by " & (C2-B2), "Equal")).

Why does my IF formula return an error like #NAME?

The #NAME error usually means there is a typo in the function name (like typing FI instead of IF) or you forgot to enclose the output text (Increase, Decrease, Equal) in double quotation marks.