×

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

Spell Check in Excel

Spell Check in Excel Microsoft Excel facilities the complete features for examining the work with text. It provides the basic properties for the proper functioning of text, including the spell-check property. The...

5 minutes read.

Text to columns in Excel

Microsoft Excel is widely used in startups to large companies. The data are entered in required rows and columns, and sometimes the data entered in one cell needs to enter...

4 minutes read.

Frequency Distribution in Excel

The term Frequency Distribution in Microsoft Excel is mainly used to explain how the data will be spread out. And it could be achieved with the help of the Histogram,...

7 minutes read.

Conditional Formatting in Excel

Conditional Formatting What are the conditional formats? Conditional Formatting is a tool that allows the user to format cells or range of cells based on the selected condition or given criteria. The formatting will...

4 minutes read.

Count Characters in Excel

Microsoft Excel is used to perform calculations for multiple purposes. The data entered in the worksheet is a combination of numeric and alphabets. Sometimes there is a need to check...

4 minutes read.

Excel MOD() Function

Excel MOD() Function The MOD() function in excel returns the remainder after a number is divided by a divisor Syntax MOD(number, divisor) Parameter Number(required)- This parameter represents the number which you want to divide. Divisor(required)- This parameter represents...

1 minute read.

Excel ROUND() Function

Excel ROUND() Function The ROUND() function in excel rounds the numbers to specified digits. Syntax ROUND(Number,num_digits) Parameter Number(required)- This parameter represents the number which you want to round up. num_digits(required)- This parameter represents the number of decimal places to which...

1 minute read.

Trendline in Excel

A Trendline is a line imposed on a graph to predict the direction of the data. It connects the series of data together to showcase the data best fit. The...

3 minutes read.

How to Delete Row in Microsoft Excel?

Individuals can quickly delete the respective row from the particular Microsoft Excel whenever they want, according to their needs and requirements. In this tutorial, we will discuss the following things in...

7 minutes read.

Excel ROUNDUP() Function

Excel ROUNDUP() Function The ROUNDUP() function in excel returns a number rounded up to the nearest possible value and away from zero. Syntax ROUNDUP(Number, num_digits) Parameter Number(required)- This parameter represents the number which you want to...

1 minute read.

Excel IF() Function

Excel IF() Function: The IF() function in excel checks whether a condition is true or not and returns one value if the condition is TRUE and another value if it's...

2 minutes read.

Excel EOMONTH() Function

Excel EOMONTH() Function The EOMONTH() function in excel returns the serial number of the last day of the month before or after a specified number of months. Syntax EOMONTH (Start_Date, Month) Parameter Start_Date(required)- This parameter...

1 minute read.

How to Highlight Duplicates Words in the Microsoft Excel?

We can easily highlight the values that are duplicated in the selected dataset, whether it could be a column or a row from the particular table, with the help of...

6 minutes read.

Excel FIND() Function

The FIND() function in excel finds one text value within another. It is a case-sensitive function. Syntax FIND (find_text, within_text, [start_num]) Parameter find_text (required)- This parameter represents the text to find. within_text (required)- This parameter represents...

1 minute read.

Copying formula in Excel

Copy a formula in Excel While working with statistical calculations in Microsoft Excel, the user uses formulas to calculate the mathematical operations. Implementing these formulas manually for each data is a...

3 minutes read.

Excel RIGHT() Function

The RIGHT() function in excel returns the rightmost characters from a text value. This function is used for data manipulation. Syntax RIGHT(Text, [num_chars]) Parameter Text (required)- This parameter represents the string from which you want to find...

1 minute read.

Blank cells in Excel

Microsoft Excel is spreadsheet software designed by Microsoft in 1987. It is used to perform arithmetic calculations in various fields like statistical, engineering and financial. Many times, we export data...

4 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.

How to Alphabetize in Excel?

Alphabetize in Excel One of the reasons for Excel's widest popularity is its ability to swiftly and effortlessly sort data. Excel facilitates easy methods that alphabetically sort the lists of strings...

5 minutes read.

Excel Function and Formulas

Excel Today() Function The today() function returns the serial number of today’s date as per system number of today’s date as per system’s regional settings. Syntax Today() Parameter NA Category Date & Time Returns This function returns today's date...

4 minutes read.