Skip to content
Related Articles

Related Articles

How to Create Custom Input and Error Messages in Excel?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 22 Mar, 2022

In Excel, you must have seen an error message before filling up any application form, admission form, and many other forms. It asks us specific things to enter like only 7 digit roll numbers or pops-up messages like no duplicate value allowed. All of these restrictions while entering data are known as error messages or custom input because it specifies the type of data to be entered. And it is used to eliminate unwanted values from the data and makes the record easy to use. In this article, we will see how to create input and error messages. 

Creating an Error Message

Suppose we have usernames and we want to enter their contact numbers of 10 digits only. Now we create an error message which will show an error message if a user tries to enter more than 10 digits in the PhoneNumber column.

 

Step 1: Click on the cell where you want to show the error input message. Then go to Data Tab>Data Tools Group>Data Validation i.e click on the Data tab and go to Data Tools and click Data Validation. Data Validation is a feature in Excel that is used by users to control the input cell values be it text, date, or numbers. You have control over the entered data.

Select-Data-Validation

Step 2: After clicking on Data Validation a drop-down(as shown below) will appear. Click on Data Validation from the drop-down.

Click-on-Data-Validation

 

Step 3: A window will open(as shown below). In the Allow column, select Text length. In Data, select equal to and in Length, select 10(because you want only 10 digit contact numbers). If you want to enter a smaller or larger number than 10, then write the required number in the last column. This step is necessary to perform to make sure the text entered in the required cell is equal to 10-digits. 

Click-on-ok-button

 

Step 4: Click on Error Alert, check the box that says Show error alert after invalid data is entered (This check box will ensure that the error message will pop-up only when the user entered an invalid value i.e value greater or smaller than a 10-digit), select Stop in Style option(this is used to restrict the user from entering any value other than 10-digit number) then enter the Title and Error message of your own choice and press OK. The title and the error message will be visible to the user only when he/she enters a larger or smaller digit other than 10-digit.

Click-on-Error-Alert

 

The error message is applied to the cell. To apply the same to all the required cells, simply hold the ‘+’ sign and drag it to the bottom of the required cells.

Final-output

 

Note:  The Invalid Entry dialogue box is the error message popped up when numbers greater than 10-digits are entered in the Phone Number column. You can use both Input Message and Error Alert at the same time. The screenshot above shows both an Error Message and an Input Message.

Creating a Custom Input Message

Step 1: Click on the cell where you want to show the error input message. Then go to Data Tab>Data Tools Group>Data Validation i.e click on the Data tab and go to Data Tools and click Data Validation. Data Validation is a feature in Excel that is used by users to control the input cell values be it text, date, or numbers. You have control over the entered data.

Select-Data-Validation

 

Step 2: After clicking on Data Validation a drop-down(as shown below) will appear. Click on Data Validation from the drop-down.

Click-on-Data-Validation

 

Step 3: A window will open(as shown below). In the Allow column, select Text length. In Data, select equal to and in Length, select 10(because you want only 10 digit contact numbers). If you want to enter a smaller or larger number than 10, then write the required number in the last column. This step is necessary to perform to make sure the text entered in the required cell is equal to 10-digits.

Click-on-ok-button

 

Step 4: After settings click on Input Message, check on the first option, and then write the message that you want to show the user. Then click OK. The title and the input message will be visible to the user when the user selects the required cell.

Click-on-Input-Message

 

You Input Message will be seen as you hover over the cell.

Input-message-output

 

The output here shows the input message that we have written. The input message will be seen as soon as the user selects the required cell.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!