How to Allow Only Yes or No Entry in Excel?


Sometimes we have a column where we want the user to enter only yes or no for the whole column. The people are entering things like "maybe" or any other words in the "Yes or No" column, and if you want to restrict the user to entering Yes or No, then we can use this simple trick in order to generate an error message if any other words are entered other than Yes or No. In this tutorial, we will learn how we can allow only yes or no entries in Excel.

Allowing Only Yes or No Entry in Excel

Here we will first add the data validation and then edit the error message. Let us look at a simple example to see how we can only allow yes or no entries in Excel.

Step 1

Consider the following Excel sheet with data similar to the image below.

For now, keep the values in the second column empty and enter those values after completing the procedure.

We use the concept of data validation to achieve our goal in this process.

Now click on the data on the quick access tool bar and select data validation. A pop-up will be opened as shown in the below figure.

Step 2

Select allow as custom as in the formula box, and then enter the formula as

=(OR(B2="YES",B2="NO")) and click on OK to complete our process as shown in the below image.

Step 3

We can also customise the error message that will be shown when we don’t enter the correct input.

To do so, in the same pop-up, click on the error alert, enter the title as yes or no, and the error message as "Please enter only yes or no in the field," then click on "OK," as shown in the image below.

Step 4

If we try to enter any value other than yes or no in the second column, an error message will be displayed, as shown in the below screenshot.

Conclusion

In this tutorial, we used a simple example to demonstrate how we can allow only yes or no entries in Excel to highlight a particular set of data.

Updated on: 09-Jan-2023

152 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements