Formula Errors

Correct Excel IF, OR, and AND Formulas for Blank or Zero Cells

Olivia MillerOlivia Miller Nov 22, 2026 868 views

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.

Correct Excel IF, OR, and AND Formulas for Blank or Zero Cells
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.
Before you start

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.

Solution 1Recommended

Return YES if either cell is blank or zero

Use OR when any one of the four checks should trigger YES.

1
Select the result cell

In the worksheet, click the cell where you want the YES or NO result.

2
Enter the formula

In the formula bar, enter =IF(OR(C18=0,C18="",D18=0,D18=""),"YES","NO") and press Enter.

3
Check the result

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 if either cell is blank or zero
Work with formulas in WPS Spreadsheet

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. 1. Open the spreadsheet: Open WPS Spreadsheet and use File > Open to select your workbook.
  2. 2. Select a result cell: Click the cell where the YES or NO result should appear.
  3. 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. 4. Save the workbook: Use File > Save or Save As to save the updated spreadsheet in your preferred format.
Check either or both cells with familiar IF, OR, and AND formulasOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar spreadsheet interfaceWork with spreadsheets using the free WPS Office suite
microsoft office alternative - wps office

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.