To do this: Select the cell where you want to apply this condition. In the above example, it is cell B5. Go to Data –> Data Tools –> Data Validation. In the data validation dialogue box, select the settings tab and make the following changes: Allow: Custom. Formula: =AND($B$1<>””,$B$3<>””).