Correct Excel IF, OR, and AND Formulas for Blank or Zero Cells
Question details
The user needs an Excel formula that returns YES when either or both specified cells are blank or zero, depending on the desired condition.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet formula checks cells C18 and D18 for blank or zero values.
- Observed behavior
- The existing formula returns NO when the user expects YES.
Confirm whether either cell or both cells must be blank or zero for the result to be YES. Replace C18 and D18 in the examples with your actual cell references.
Return YES if either cell is blank or zero
Use OR when any one of the four checks should trigger YES.
In the worksheet, click the cell where you want the YES or NO result.
In the formula bar, enter =IF(OR(C18=0,C18="",D18=0,D18=""),"YES","NO") and press Enter.
Change or inspect C18 and D18: the formula returns YES if either cell is blank or zero, and NO if neither meets those conditions.

Return YES only if both cells are blank or zero
Use AND with separate OR checks when each cell must independently be blank or zero.
Check Blank or Zero Cells in WPS Spreadsheet
Use IF, OR, and AND in WPS Spreadsheet to return YES or NO based on blank or zero values, and continue working with Excel-compatible files.
- 1. Open the spreadsheet: Open WPS Spreadsheet and use File > Open to select your workbook.
- 2. Select a result cell: Click the cell where the YES or NO result should appear.
- 3. Enter the formula: Type =IF(OR(C18=0,C18="",D18=0,D18=""),"YES","NO") in the formula bar and press Enter. Replace the references if needed.
- 4. Save the workbook: Use File > Save or Save As to save the updated spreadsheet in your preferred format.

Frequently Asked Questions
How do I return YES only when both cells are blank or zero?
Enter =IF(AND(OR(C18=0,C18=""),OR(D18=0,D18="")),"YES","NO") in the result cell. Each cell may be blank or zero, but both must meet one of those conditions.
Does ="" detect a cell containing a formula that returns an empty string?
Yes. A comparison such as C18="" can match a truly empty cell or a cell whose formula returns an empty string. Use ISBLANK(C18) if you need to test whether the cell is truly empty.
Why can a blank cell match a zero comparison in Excel?
Excel can treat a truly empty cell as zero when comparing a cell reference with 0. To distinguish a truly empty cell, use ISBLANK(C18) as a separate check.
What if Excel does not accept commas in the formula?
Your regional settings may require semicolons as argument separators. Replace the commas between formula arguments with semicolons and enter the formula again.
Will these formulas treat the text value "0" as a numeric zero?
Not necessarily. If a cell contains the text "0" rather than the number 0, convert it to a number or add a separate text comparison such as C18="0" to the OR function.




