How to Write an Excel Nested IF Formula for Eligible or Ineligible Categories
Question details
The user needs a formula to classify a numeric value into specific text outcomes based on defined number ranges without the logical conditions overlapping.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Categorizing data points into text groups ('Eligible', 'Ineligible', or 'Follow Up') based on multiple threshold ranges (2–20, 21–70, 71–85, and 86 or higher).
- Observed behavior
- Requires a correctly structured nested IF statement evaluating from the highest to the lowest value to ensure each number falls into the exact correct bucket.
Identify the target cell containing the value you want to evaluate and firmly define the numerical boundaries for each category before constructing your formula.
Use a Nested IF Formula Evaluated from Highest to Lowest
Construct a nested IF function that tests the highest threshold first to ensure values are categorized accurately without logic overlap.
When evaluating greater-than conditions using a nested IF function, it is essential to evaluate the conditions in descending order. Since spreadsheets evaluate IF statements left-to-right, testing the highest value first prevents a lower threshold from prematurely capturing a higher value.
Click on the cell where you want the categorization text to appear.
Assuming the value to evaluate is in cell A1, type the formula: =IF(A1>=86,"Ineligible",IF(A1>=71,"Follow Up",IF(A1>=21,"Eligible",IF(A1>=2,"Ineligible",""))))
Press Enter to calculate the result, then drag the fill handle down to apply this formula to the rest of the cells in your data column.

Use the IFS Function for Cleaner Syntax
For modern spreadsheet users, the IFS function offers a cleaner way to evaluate multiple conditions without complex nesting.
Write and Test Nested Formulas Smoothly in WPS Spreadsheet
WPS Spreadsheet fully supports advanced logical functions including IF and IFS. It provides color-coded syntax highlighting and intuitive tooltip hints to make writing nested formulas error-free.
- 1. Open your spreadsheet in WPS: Launch WPS Office and open your workbook containing the data to be categorized.
- 2. Access the Formula tab: Navigate to the Formula tab on the top ribbon and select 'Insert Function' to find logical functions like IF or IFS.
- 3. Input the conditions: Follow the intuitive dialog box to enter your logical tests and return values, or directly type your nested IF structure into the formula bar.

Frequently Asked Questions
Why is my nested IF formula returning the wrong category for high numbers?
This happens when the logical conditions overlap. In a 'greater-than' formula, you must test your thresholds from highest to lowest. If you test '> 20' before '> 80', the formula will see that 85 is greater than 20 and stop evaluating, returning the wrong category.
How many IF statements can I nest in a spreadsheet?
In modern versions of Excel and WPS Spreadsheet, you can nest up to 64 IF functions. However, if you need that many conditions, it is much easier to maintain a separate reference table and use a VLOOKUP or XLOOKUP function.
What does the empty string at the end of the IF formula mean?
The "" (two double quotes with nothing between them) at the end of the formula tells the software to display a blank cell if none of the previous logical conditions are met. Without it, the formula would simply return the word 'FALSE'.
Can I use VLOOKUP instead of a nested IF for categorization?
Yes. For categorizing more than three or four ranges, creating a small reference table and using VLOOKUP with an approximate match (setting the last argument to TRUE) is often cleaner and easier to update than a long nested IF formula.




