Formula Errors

Fix an Excel Formula to Classify Two Values with Nested IF

John WilsonJohn Wilson Dec 2, 2026 868 views

Question details

The user needs to fix a formula that assigns a category based on whether two values are positive or negative.

Classify Two Excel Values with a Nested IF Formula
Product
Microsoft Excel
Device & OS
not provided
Scenario
Classify the values in cells I24 and M24 into four categories using a nested formula.
Observed behavior
The existing formula produces a VALUE error instead of the intended category.
Before you start

Check that I24 and M24 contain numeric values rather than text or errors. Decide whether zero should be grouped with negative or positive values; the formula below treats zero as nonpositive.

Solution 1Recommended

Correct the nested IF formula

Use this formula to check I24 first, then select a category based on M24.

The formula assigns REMEDIATE when both values are nonpositive, ANTICIPATE when only I24 is nonpositive, MOMENTUM when only M24 is nonpositive, and GROWTH when both are positive.

1
Select the result cell

In Excel, click the cell where you want the category to appear.

2
Enter the corrected formula

In the formula bar, enter =IF(I24<=0,IF(M24<=0,"REMEDIATE","ANTICIPATE"),IF(M24<=0,"MOMENTUM","GROWTH")) and press Enter.

3
Apply it to other rows

Select the result cell and drag its fill handle down to classify the corresponding values in other rows.

Correct the nested IF formula
Check your inputs and separators: If an error remains, inspect I24 and M24 for errors or nonnumeric entries. Depending on your regional settings, you may need to replace the formula's commas with semicolons.
WPS Spreadsheets

Classify values with nested IF in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use the same nested IF formula to assign categories based on two cell values.

  1. 1. Open the workbook: In WPS Spreadsheets, open the workbook containing the values to classify.
  2. 2. Select a result cell: Click the cell where you want the category for row 24 to appear.
  3. 3. Enter the formula: Type =IF(I24<=0,IF(M24<=0,"REMEDIATE","ANTICIPATE"),IF(M24<=0,"MOMENTUM","GROWTH")) in the formula bar and press Enter.
  4. 4. Fill other rows: Drag the result cell's fill handle down to apply the formula to additional rows.
Classify two values into four categories with a nested IF formula.Open and edit Microsoft Excel XLSX and XLS workbooks.Fill the formula down to apply it to additional rows.
microsoft office alternative - wps office

Frequently Asked Questions

How does the formula classify zero?

The <=0 comparisons group zero with negative values. For example, if both I24 and M24 are zero, the result is REMEDIATE. Change the comparisons if zero should belong to a different group.

Why does my formula still show an error?

Check I24 and M24 for existing errors or nonnumeric entries, and make sure the formula's parentheses are balanced. If Excel rejects the separators, try semicolons instead of commas.

Can I use AND instead of checking one cell at a time?

Yes. You can use AND inside nested IF functions to test both cells for each category, but make sure the conditions cover zero as well as positive and negative values.

How do I use the formula for other rows?

Select the formula cell and drag its fill handle down. The relative references I24 and M24 will adjust to each row.