Function Problems

How to Create an Excel Nested IF Formula with Text and Number Conditions

Khadija KhanKhadija Khan Nov 10, 2026 869 views

Question details

The user needs to write a nested IF formula in Excel that evaluates conditions across different columns, returning text for a specific text condition and a number for a numeric threshold.

How to Create a Nested IF Formula with Text and Number Conditions in Excel
Product
Excel
Device & OS
not provided
Scenario
Evaluating multiple criteria in a dataset where one column dictates a text output (e.g., checking if a material is 'CONCRETE') and another dictates a numeric output based on a threshold (e.g., value less than 12).
Observed behavior
The user is looking for the correct syntax to combine both text and numeric evaluations in a single nested IF statement without incorrectly evaluating entire column ranges.
Before you start

Ensure your data is organized in clear columns and that you write the formula referencing the cells in the first row of your dataset before copying it down.

Solution 1Recommended

Using a Standard Nested IF Formula

This method uses standard nested IF logic to evaluate the text condition first, followed by the numeric condition, returning the appropriate result for the specific row without the need for the AND function.

When working with row-by-row data, it is best practice to reference individual cells (like E3 and D3) rather than entire ranges (like E3:E34) in your logical test. By writing the formula for the first row and using the fill handle to copy it down, Excel automatically adjusts the cell references relative to each subsequent row.

1
Select the Target Cell

Click on the cell in the first row where you want the formula result to appear.

2
Enter the Nested IF Formula

Type the formula =IF(E3="CONCRETE","MANHOLE REHABILITATION",IF(D3<12,5,6)) into the formula bar. Replace E3 and D3 with the actual cell references for your text and number columns, respectively.

3
Press Enter

Press the Enter key on your keyboard to calculate the result for the first row.

4
Fill Down the Formula

Hover your mouse over the bottom-right corner of the cell until the cursor turns into a plus sign (+). Click and drag the fill handle down to apply the formula to the rest of the column.

Using a Standard Nested IF Formula
Order of Evaluation: The IF function evaluates conditions from left to right. Once it finds the first TRUE condition, it returns that corresponding value and stops evaluating the remaining nested conditions.
Easily Manage Data with WPS Office

Use WPS Spreadsheet for Advanced Formulas

WPS Spreadsheet offers full support for complex, nested formulas like IF, VLOOKUP, and IFS. Its intuitive interface and intelligent formula autocomplete make evaluating large datasets and handling multiple logical conditions effortless.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the dataset in the Spreadsheet module.
  2. 2. Input the Data: Ensure your text and numeric conditions are clearly separated into their respective columns.
  3. 3. Apply the Formula: Select the target cell and type your nested IF formula. Use the helpful tooltip suggestions provided by WPS to verify your syntax as you type.
  4. 4. Drag to Fill: Use the small square fill handle at the bottom right of the cell to drag the formula down and apply it to all rows instantly.
Fully compatible with Microsoft Excel formulas and functions, supporting the .xlsx format flawlessly.Intelligent formula prompting and syntax highlighting to help you write nested IF functions without errors.Free to use with a lightweight installation and fast data processing speed.Built-in data validation and conditional formatting to complement your logical formulas.
microsoft office alternative - wps office

Frequently Asked Questions

Why shouldn't I use entire column ranges like E3:E34 inside my IF formula?

Using an array range like E3:E34 in a standard IF formula's logical test might result in a SPILL error or evaluate the wrong row on newer versions of Excel. It is a best practice to reference the specific cell for that row (e.g., E3) and drag the formula down to let Excel adjust the rows automatically.

Can I add more conditions to my nested IF formula?

Yes, you can nest up to 64 IF functions in a single formula. Simply replace the final 'value_if_false' argument with another IF statement. Alternatively, consider using the IFS function for better readability when dealing with many conditions.

Why does my formula return an error when checking for text?

Ensure that your text string is enclosed in double quotation marks (e.g., "CONCRETE"). Without quotes, Excel will assume you are referencing a named range or function and will return a #NAME? error.

Do I need to use the AND function for this scenario?

Not in this specific case. Since you are evaluating separate conditions sequentially—if it's Concrete, return text; otherwise, if the number is less than 12, return a number—nesting the IF statements handles the fallback logic perfectly without needing the AND() function.