Excel IF Formula for Multiple Conditions and Blank Cells
Question details
Create an Excel formula that returns different results for X, Y, other values, and blank cells.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Evaluate a value in column D and return a matching description or a blank result.
- Observed behavior
- The desired formula returns X Blah for X, Y Blah for Y, an empty result for a blank cell, and Something Else for other values.
Identify the cell containing the value to test and the cell where you want the result. The example uses D2 as the input and can be entered in another cell, such as E2.
Use a Nested IF Formula to Check Values and Blanks
Use this formula when one cell can contain X, Y, another value, or no value.
In Excel, select E2 or another empty cell where you want the result to appear.
Type =IF(D2="X","X Blah",IF(D2="Y","Y Blah",IF(D2="","","Something Else"))) and press Enter.
Select the formula cell and drag its fill handle down to evaluate the corresponding cells in column D.

Evaluate Multiple Conditions in WPS Spreadsheet
Use the same nested IF formula in WPS Spreadsheet to return a result for X, Y, other values, or a blank input.
- 1. Open your spreadsheet: Open WPS Spreadsheet and choose Open to select your workbook.
- 2. Select a result cell: Click E2 or another empty cell beside the value in D2.
- 3. Enter the IF formula: Type =IF(D2="X","X Blah",IF(D2="Y","Y Blah",IF(D2="","","Something Else"))) and press Enter.
- 4. Fill other rows: Drag the fill handle from the formula cell down to apply the formula to additional rows.

Frequently Asked Questions
How do I make the formula return a blank result?
Use D2="" to test for a blank value and "" as the result, as in IF(D2="","","Something Else").
Why does a cell containing a space return Something Else?
A space is a character, so it does not match the empty string in D2="". Remove the space from D2 if the cell should be blank.
How do I change the text returned for X or Y?
Edit the formula in the formula bar and replace "X Blah" or "Y Blah" with your preferred text, keeping the quotation marks.
What if Excel reports a formula syntax error?
Check that the parentheses and quotation marks match. Depending on your regional settings, you may also need to replace the commas between arguments with semicolons.




