How to Use Excel IF Formula to Return a Keyword from Two Cells
Question details
The user needs an Excel formula to evaluate two cells and return a text keyword from one of them, or a default value if both are blank, while strictly ignoring numeric entries.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Evaluating multiple columns in a dataset to extract a specific text keyword while skipping blank cells and numeric values.
- Observed behavior
- The user requires a nested logical formula using IF, ISBLANK, and ISNONTEXT to accurately return the correct text value or fallback value based on the cell contents.
Identify the specific columns containing your keywords and your default fallback values before building the formula to ensure accurate cell referencing.
Use a Nested IF Formula with AND, OR, ISBLANK, and ISNONTEXT
Combine logical functions to check for blanks and non-text values, returning the appropriate cell content based on the conditions.
This formula evaluates whether the primary cells are empty or contain numbers instead of text. The ISBLANK function checks for empty cells, while ISNONTEXT ensures numeric entries are ignored, allowing the formula to correctly select the text keyword or default to a fallback value.
Click on the cell where you want the final extracted keyword to be displayed.
Type the formula: =IF(AND(ISBLANK(E78),ISBLANK(F78)),A78,IF(OR(ISBLANK(E78),ISNONTEXT(E78)),F78,E78)). Replace row 78 with your actual row number and column letters with your specific data columns.
Press Enter on your keyboard to calculate the result for the current row.
Click and drag the fill handle at the bottom-right corner of the cell down to apply this logic to the rest of your dataset.

Master Complex Formulas with WPS Spreadsheet
WPS Spreadsheet offers full support for advanced logical functions like IF, AND, OR, ISBLANK, and ISNONTEXT, allowing you to easily process data and build complex keyword extraction rules.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data.
- 2. Start your formula: Select the target cell and type =IF( to bring up the intelligent formula tooltip.
- 3. Build the logical statement: Follow the on-screen function guides to input your nested AND, OR, and ISBLANK arguments accurately.
- 4. Apply across rows: Press Enter to calculate the result and double-click the fill handle to apply it across all rows instantly.

Frequently Asked Questions
Why does my IF formula return a #NAME? error?
This usually happens if a function name is misspelled, such as typing ISBLNK instead of ISBLANK, or if text strings inside the formula are not enclosed in double quotation marks.
Can I use the IF function to check more than two cells?
Yes, you can nest additional IF functions or expand the AND and OR arguments to include more cell references, for example: AND(ISBLANK(E1), ISBLANK(F1), ISBLANK(G1)).
How do I make the formula return empty instead of a value if all cells are blank?
Replace the fallback cell reference with an empty string represented by two double quotes. For example: =IF(AND(ISBLANK(E78),ISBLANK(F78)), "", ...)
What is the difference between ISBLANK and checking for an empty string?
The ISBLANK function only returns TRUE if a cell is completely empty. If a cell contains a formula that evaluates to an empty string (""), ISBLANK will return FALSE. In such cases, use E78="" instead of ISBLANK(E78).




