Fix an Excel Formula to Classify Two Values with Nested IF
Question details
The user needs to fix a formula that assigns a category based on whether two values are positive or negative.

- 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.
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.
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.
In Excel, click the cell where you want the category to appear.
In the formula bar, enter =IF(I24<=0,IF(M24<=0,"REMEDIATE","ANTICIPATE"),IF(M24<=0,"MOMENTUM","GROWTH")) and press Enter.
Select the result cell and drag its fill handle down to classify the corresponding values in other rows.

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. Open the workbook: In WPS Spreadsheets, open the workbook containing the values to classify.
- 2. Select a result cell: Click the cell where you want the category for row 24 to appear.
- 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. Fill other rows: Drag the result cell's fill handle down to apply the formula to additional rows.

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.




