×

Data Validation in Excel

What is Data Validation?

Data Validation is one of the features in Excel that allows user to restrict values which other people can fill in – for example, in a form, you may have options like ‘Mr’, ‘Ms’ or ‘Mrs’, for gender you may have ‘Male’ or ‘Female’, for employee contract you may have ‘Permanent’ or ‘Temporary’ – the whole idea of Data Validation is to give others a list of options to choose from so that the data when entered is consistent.

Data Validation feature improves the efficiency of data entry in excel and reduces mistakes and typing errors. You can have restricted entries as per the validation criteria or even create custom rules for what can be entered in the cell. In case of any invalid entry, it shows a message and prevents the user from entering the data based on a specified condition. For example, in gender, some users might fill M or F or Male or Female – thus, rather than having some fill M and some fill Male – it will always be better to give 1 option either a Male or M.

Similarly, for an employment contract, you may not want everyone to fill different options like ‘Permanent’ or ‘Full-time’ or ‘Contractor’ or ‘Temporary’ or ‘Part-Time’ – but you may want to limit the number of options so that it becomes easier for you to analyze the data.

How to apply data validation?

  • Select the cells on which you want to apply Data Validation
  • Go to Data tab and click on ‘Data Validation’.
  • On the settings tab – default would be ‘Any Value’ which means that there is no limitation currently on the cells which have been selected
  • Choose the relevant option
Different options for Data Validation

Different options for Data Validation

Whole Number – it will restrict users from entering a text or even numbers consisting of decimal points. You can also specify the range in which you want people to enter the numbers – for example: Age for a driving license application needs to be greater than 18 and less than 70.

In the example below, we have taken a range between 5 and 15. The second picture shows that as soon as you add a decimal point and press enter, excel gives an error that this value doesn’t match the data validation restrictions, and we need to change the value.

Whole Number
Different options for Data Validation

Decimal - it will restrict users from entering a text. You can enter whole numbers or numbers, which consist of decimal points. You can also specify a range in which you want users to enter values, or greater than, less than functionalities can also be used using the Data field.

Decimal

List – You can specify a list of items which can be entered in a cell – for ex: for an employee contract the values can be ‘Permanent’, ‘Temporary’ – for list of analytics tool courses it can be ‘MS Excel’, ‘SAS’, ‘R’, ‘Tableau’

For specifying a list, you will first need to write down the list at another location in the excel file and then give the path of the list in the Source field. In the below example, we have created a list of analytics tool courses and given the location of those cells in the ‘Source’ field. When you click on ‘OK’, these lists of courses will start appearing in the cells which we had selected for Data Validation – over here in Column J as can be seen in the second picture below.

Date - You can restrict cells such that users can enter only dates and in that too you can restrict dates by using the ‘Data’ option.

Time - You can restrict cells such that users can enter only dates and in that too you can restrict dates by using the ‘Data’ option.

Text Length - You can restrict cells such that users can enter only text which is of/between specified length by using the ‘Data’ option

For example, if you don’t want the user to enter more than 10 characters, you can select text length, and whenever the user exceeds 10 characters, excel will throw an error

excel will throw an error

Custom – you can enter your own formula in data validation – ISODD – look for other examples

Highlight Cells Rules

Input Message

If you want to display a message whenever a user selects the cells containing Data Validation, you can use ‘Input Message’ and write relevant information in ‘Title’ and ‘Input Message’ fields. Make sure that the ‘Show input message when the cell is selected’ checkbox is ticked.

Input Message

Example 1

Objective: How many hours do you work per day? Enter hours between 1 and 12

The procedure of the above example is as follows:

Step 1- Click on Data --> Data Tools --> Data Validation

Step 2- In the Setting section, under Data select between and the required minimum and maximum value range.

Data select between and the required minimum and maximum

Step 3: Type an appropriate input message.

Type an appropriate input message

Step 4: Create your own error alert to warn the user for wrong or invalid entry.

user for wrong or invalid entry.

Result

Condition 1: When the cell is blank.

When the cell is blank

Condition 2: When you have entered the right value.

When you have entered the right value.

Condition 3: When you have entered a wrong value or value out of the range (1-12). Here we have put the value 18 in the cell that is out of the range (1-12).

When you have entered a wrong value or value out of the range

Related Topics

Excel WEEKNUM() Function

The WEEKNUM() function in excel returns the week number from 1 to 54 of a specific date in a year. The WEEKNUM function starts counting with the week that contains January 1...

1 minute read.

Excel TEXT() Function

The TEXT () function in excel converts a supplied numerical value into the text of a specific format. Syntax TEXT(Value, Format_text) Parameter Value (required)- This parameter represents the value for which we need to...

1 minute read.

Excel COUNTIFS() Function

Excel COUNTIFS() Function The COUNTIFS() function in excel is used to count the numbers within a range that meet the supplied criteria.  Syntax COUNTIFS (range1, criteria1, [range2], [criteria2], ...) Parameter Range1 (required)- This parameter represents...

1 minute read.

Excel Unique Values

The Unique function in Excel filters the list of unique values from the given data like range or array. The data presented is either number, text, date, time etc. This...

3 minutes read.

How to make use of the Wildcard in Excel

In this modern world, it is known that the wildcard characters in Microsoft Excel are considered to be the most essential and unrated features of Microsoft Excel. Besides all these,...

8 minutes read.

How to remove duplicate values from excel?

Remove duplicate values from excel Duplicate values occur when the same date or set of values is repeated in your Excel sheet. While working with Excel sheets many a time, the...

5 minutes read.

Excel WORKDAY() Function

Excel WORKDAY() Function The WORKDAY() function in excel returns the serial number of the date before or after a specified number of workdays. Syntax WORKDAY (START_DAY, DAYS, [HOLIDAYS]) Parameter START_DAY (required)- This parameter represents the...

1 minute read.

Excel MID() Function

The MID() function in excel is used to return a specific number of characters from a text string starting at the position you specify. One can change the start of the string, thus...

1 minute read.

Excel SEARCH() Function

The SEARCH() function in excel finds one text value within another. It is the same, unlike FIND() function, with the only difference that it in a case-insensitive function. Syntax SEARCH (find_text, within_text, [start_num]) Parameter...

1 minute read.

Dependent Combo box in Excel VBA

Adding the particular dependent box in the created User form with the help of the Microsoft Excel VBA is considered essential and crucial in Microsoft Excel. Here, in this tutorial, we...

7 minutes read.

Auto Fill and Flash fill

Fill Features Excel provides an amazing feature to fill the data automatically, if the available data is present in the form of any pattern. Instead of entering your data manually, you can use...

3 minutes read.

Absolute Value in Excel

What is Absolute Value in Excel? Microsoft Excel worksheet is a combination of numeric values and alphabets. The numeric value is either a positive value or a negative value. Sometimes the...

5 minutes read.

What is a name box in Excel?

The name box in Microsoft Excel specifies a name for a single cell or a table. The name box is present in the top left corner, left to the formula...

4 minutes read.

Calculating the Last Day of the Month in Excel

In Microsoft Excel, various functions exist to calculate the date and time from the current date to the past and future. Among multiple tasks in this tutorial, let's see how...

3 minutes read.

How to use TODAY function in Excel

What is TODAY Function in Excel? Today function is one of the types of Worksheet function (WS) in Excel.Today Function belongs to the Date and Time functions.It is used to calculate...

3 minutes read.

Basics of Excel

Different ways to open an excel file There are various ways to open an excel file, some of them are listed below - From Start Menu:Go to the start menu and search for Ms-Excel...

5 minutes read.

How to apply Advanced Filter in Excel

It was known that the advanced filter in Microsoft Excel is termed to be the next level filter option that is available in the particular "Data Menu Tab", which is...

7 minutes read.

AutoFill in Excel

AutoFill in Excel Excel is known for its credibility to operate repeated and similar tasks automatically. For this purpose, it facilitates an inbuilt feature known as Autofill that recognizes the series of...

3 minutes read.

Adding Column in Excel

Excel spreadsheet is a combination of rows and columns. After creating the table, there is a need to insert additional row or columns. To organize a better worksheet for calculations,...

5 minutes read.

Excel MINUTE() Function

Excel MINUTE() Function The MINUTE() function in excel converts a serial number to minute (0 - 59). Syntax MINUTE (SERIAL_NUMBER) Parameter SERIAL_NUMBER (required)- This parameter represents the date or time from which you want to extract...

1 minute read.