logo
search
Function Problems

How to Use Excel IF Formula to Return a Keyword from Two Cells

Huma Ashraf ChHuma Ashraf Ch Oct 23, 2026 869 views

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.

How to Use an Excel IF Formula to Return a Keyword from Two Cells
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.
Before you start

Identify the specific columns containing your keywords and your default fallback values before building the formula to ensure accurate cell referencing.

Solution 1Recommended

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.

1
Select the target cell

Click on the cell where you want the final extracted keyword to be displayed.

2
Enter the nested IF formula

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.

3
Apply the calculation

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

4
Copy the formula to other rows

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.

Use a Nested IF Formula with AND, OR, ISBLANK, and ISNONTEXT
Understanding the Logic: The formula first checks if both E and F are blank; if true, it returns A. If not, it checks if E is blank or contains a number (ISNONTEXT); if true, it returns F. Otherwise, it defaults to returning E.
Advanced Data Processing

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. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data.
  2. 2. Start your formula: Select the target cell and type =IF( to bring up the intelligent formula tooltip.
  3. 3. Build the logical statement: Follow the on-screen function guides to input your nested AND, OR, and ISBLANK arguments accurately.
  4. 4. Apply across rows: Press Enter to calculate the result and double-click the fill handle to apply it across all rows instantly.
100% compatible with Microsoft Excel formulas and functionsSyntax highlighting and formula hints for easy troubleshootingFree and lightweight alternative for seamless data analysis
microsoft office alternative - wps office

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).