How to Create an Excel Formula to Return Yes or No When Cells Are Filled
Question details
The user needs an Excel formula that checks if three nonconsecutive cells contain dates, returning a green 'Yes' if all are filled, and 'No' otherwise.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Checking multiple nonconsecutive date cells for completeness using a logical formula.
- Observed behavior
- Returns 'Yes' in green only when all three specified cells are filled with dates; returns 'No' if any required cell is empty.
Identify the exact cell references you need to check (e.g., B2, D2, F2) and ensure the cells you want to check for dates do not contain hidden spaces.
Use IF and OR Functions with Conditional Formatting
This solution combines logical formulas to verify if any required cells are blank and applies conditional formatting to highlight the 'Yes' result in green.
By nesting the OR function inside the IF function, you can check multiple cells simultaneously. If any one of the specified cells is empty, the formula triggers the 'No' response. If all are filled, it returns 'Yes'.
Click on the cell where you want the Yes/No result to appear.
Type the formula =IF(OR(B2="",D2="",F2=""),"No","Yes") into the formula bar, replacing B2, D2, and F2 with your specific cell references, then press Enter.
Keep the result cell selected, go to the 'Home' tab on the ribbon, and click 'Conditional Formatting'.
Choose 'Highlight Cells Rules' > 'Equal To', type 'Yes' in the dialog box, and select 'Custom Format' from the drop-down menu to change the font or fill color to green.
Alternative: Use IF and AND Functions
Instead of checking for blank cells, you can directly check if all cells contain a value using the AND function.
Easily Apply Logical Formulas and Formatting in WPS Spreadsheet
WPS Office provides robust support for logical formulas like IF, AND, and OR, along with an intuitive conditional formatting interface to help you track data seamlessly and beautifully.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your date cells.
- 2. Input the formula: Select your target cell and input the =IF() logical formula.
- 3. Apply Conditional Formatting: Navigate to the Home tab and select Conditional Formatting to easily apply the green highlight rule for the 'Yes' outcome.

Frequently Asked Questions
Why does my formula return 'Yes' when a cell is actually empty?
Check your logical operators and cell references. If you are using the AND function, ensure you are checking that cells are NOT empty (<>""). If using the OR function, ensure you are checking if cells ARE empty (=""). Also, ensure the seemingly blank cell doesn't contain a hidden space character.
Can I check more than three cells using this formula?
Yes, you can add as many cell references as needed inside the OR or AND functions, separated by commas (for example: OR(B2="",D2="",F2="",H2="")).
How do I format the 'No' result in red automatically?
Select your formula cell, go to Conditional Formatting > Highlight Cells Rules > Equal To, enter 'No' in the prompt, and choose a red fill or red text color format.




