Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Excel Tutorial
  • Excel Formulas
  • Excel Shortcut Keys
  • Data Analysis in Excel
  • Formatting in Excel
  • Excel Workbooks
  • Statistical Functions
  • Data Visualization in Excel
  • Pivot Tables in Excel
  • MS Excel Quiz
  • Excel Interview Questions
  • Advance Excel
Open In App
Next Article:
Chart Visualizations in Excel Power View
Next article icon

Data Validation in Excel

Last Updated : 13 Dec, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Microsoft Excel is a powerful tool and is widely useful too. It has various features to ease our work. One such feature is Data Validation. Now suppose you want the user to enter some specific values into the cells and for that, you need to set some pre-defined rules so that the user wouldn't be able to enter other values and that's where Data Validation steps in.

What is Data Validation in Excel

Data Validation gives you the control to receive particular inputs from users. We all have encountered using this feature in our day-to-day lives, one such example is while filling out forms in which the age cell will accept numbers similarly name column accepts text with limited characters, and the date of birth will have years pre-defined to rule out the ineligible candidates.

How to do Data Validation in Excel

The data validation function can be found in the DATA tab from the Excel ribbon(as seen in the picture below).

Step 1: Click on the Data Tab in the Ribbon.

Step 2: Now select Data Validation.

Data validation in Excel
In se

After clicking on Data Validation, a menu appears.

Data Validation menu.

Step 3: Select Data Validation and a dialogue box appear.

Data Validation Dialogue Box

There are 3 tabs in the dialogue box.

  1. Settings: This will help you to select the data type and the type of data that you want to be filled in the desired row or column.
  2. Input Message: This tab will help to let the user know about the constraints you've decided on for the row/column. It will alert the user to input the right set of values.
  3. Error Alert: The error alert tab will help the user to know that they had entered invalid data.

Note: The data validation feature is not 100 percent reliable. If you will try to copy the data from cells which has no defined validation rules and then try to paste those cells to cells having data validation then all the validation part get vanished. Basically, validation rules get changed from the corresponding cell based on the copied cell content.

Settings Tab

In the settings tab, you can find options to set validation criteria. The Setting Tab helps us to choose the validation rule as per your need from the in-built options. We also have the option to select custom rules with the customized formula for user inputs. There are all the options for Data Validation in the settings tab.

Setting Tab in Data Validation.

Input Message Tab (Optional)

The Input Message Text tab has a Text box to enter a message displayed as soon as the user selects the respective cell to enter the data.

If you want to display a message that helps the user to understand what type of data is allowed to enter in the data in the given cell.

Follow the below steps:

Step 1: Open the Input Message Tab.

Step 2: Make sure there should be a tick mark on the "When a cell is selected, show input message".

Step 3: Enter the Title and Text of your message in the fields.

Step 4: As soon as the user selects the Validated cell, It will show this message.

Input message in Data Validation.

Error alert Tab (Optional)

The error alert tab helps us to provide the option to control how the validation is enforced. We can apply different criteria and then use any desired error style according to the user input. We can also display a message to the user informing them about the type of error and what values must be entered in the given cells.

There are three types of error styles in Excel

  • Stop
  • Warning 
  • Information

If you want to configure a custom error alert message then follow the steps below:

Step 1: Click on the Error Alert in the Data Validation

Step 2: Make sure there is a tick mark in the box "Show error alert after invalid data in Entered".

Step 3: You can Select the desired error style in the Style box.

Step 4: Enter the title and text of the error message and click "ok".

Error Alert in Data Validation.

Excel Data Validation List

Data Validation also provides a feature of adding a drop-down list to a cell or group of cells.

Follow the below steps to add a drop-down list:

Step 1: Select a cell in which you want to add the drop-down list.

Step 2: On the setting tab,  Enter List in the Allow box.

Step 3: Type the Items of your  Excel Validation list in the Source Box, Separated by commas For example To limit the user input into two choices type Yes, NO.

Step 4: Now select the In-cell dropdown box in order for the drop-down arrow to appear next to the cell. 

Step 5: Press "OK"

Drop down list in Data Validation.

Example of Data Validation

Let's take the example of filling out a form. The form requires your name which has a limitation of 3-7 characters, it requires your date of birth, and has a list of cities for the exam center. Not considering all the other requirements as of now.

The form looks like this.

Form table

To apply data validation with a word limit of 3-7 characters for the Name cell.

Step 1: Select the empty cell in front of the Name.

Step 2: From the DATA tab in the ribbon, select Data Validation.

Step 3: A Dialogue box will appear.

Step 4: In the dialogue box from the setting tab, in the dropdown, select Text Length (as shown in the image below).

text length selection

Step 5: We want our user to enter the name between 3-7 characters, So in the Minimum column we'll write 3 and in the Maximum column we'll write 7 and then click OK.

Text Length

The Name row will now accept only text between 3-7 characters.

To use Data Validation as Date of Birth

Step 6: Select the cell in front of Data of Birth in Excel.

Step 7: Repeat steps 2 and 3.

Step 8: In this step, instead of selecting text length, you need to select Date (as shown in the image below).

Date in data validation

 If you want the user must be born between 1st January 2000 to 1st January 2021.  Enter the Start date as 1st January 2000 and the End date as 1st January 2021. 

Date range

Step 9: Click OK.

Now, the Date of Birth row will accept dates between 1st January 2000 to 1st January 2021.

Excel Data Validation List (Dropdown)

Step 10: Select the empty cell in front of the Exam Centre.

Step 11: Repeat steps 2 and 3.

Step 12: Select List (as shown in the image below).

List in data validation

You want to add "Kanpur", "Agra", "Aligarh", "Lucknow", "Varanasi" to the list.

Step 13: Add the names in the source column separated by a comma(,).

list source in data validation

Step 14: Click OK.

The Exam center cell will look like this.

Final data

You've successfully created a form with 3 requirements using Data Validation.

Date Validation

Date Validation can be set -up in Excel. Select date in the allow box and pick up the appropriate criteria.

Follow the below steps to set-up date validation:

Step 1: Select the cell

Select the cell where you'd be applying the data validation

Step 2:



Next Article
Chart Visualizations in Excel Power View

S

sakshiravindrasinghal
Improve
Article Tags :
  • Excel
  • News
  • Microsoft Office
  • Excel-functions
  • ExcelGuide

Similar Reads

  • Data Visualization in Excel
    Data visualization in Excel is a powerful way to transform complex datasets into clear, interactive visuals that are easy to understand and analyze. Whether you are presenting sales performance, tracking project progress, or comparing trends, using charts and graphs in Excel can make your data more
    5 min read
  • How to Normalize Data in Excel?
    The term "normalization" is a popular buzzword among professionals in fields like Machine Learning, Data Science, and statistics. It refers to the process of scaling down values to fit within a specific range. The term is often misunderstood and is sometimes used interchangeably with "standardisatio
    6 min read
  • Data Formatting in Excel
    In Excel, the whole entered data in the sheet uses the same formatting by default which can make the data look monotonous, dull, and difficult to read. Excel provides a pool of tools called formatting tools which customize the data in such a way that it only affects the appearance of the data and no
    3 min read
  • How to plot excel data in R?
    Plotting graph in R using an excel file, we need an excel file with two-column in it, the values in the first column will be considered as the points at the x-axis and the values in the second column will be considered as the points at the y-axis. In this article, we will be discussing the approach
    2 min read
  • Chart Visualizations in Excel Power View
    Power View is an Excel Visualization tool that allows you to build visually appealing graphs and charts, dashboards for management, and reports that can be issued daily, weekly, or monthly. When we think of Microsoft Excel, we think of various tools such as Formulae, which makes an analyst's job sim
    8 min read
  • Richer Data Labels in MS Excel
    Data labels can be both elegant and helpful. You may add freeform text and formatting to your data labels as well as rich, resizable text from data points or any other text to make them appear in almost any shape. Even when you transition to a different type of chart, the data labels remain in place
    4 min read
  • Data Visualizations in Power View
    Data visualization is a technique to represent the data or set of information in charts. Excel gives a tool of Power View where we can explore the data interactively and also we can visualize the data such that data can be presented in Tables, Bar charts, Scatter plots, and Pie charts. This tool can
    3 min read
  • Line Chart Visualization in Excel Power View
    Power View is the visualization technology that brings our data to life. It is available in Microsoft Excel, on Power BI desktop or we can use it using an SQL server. With the help of power view, we can create on-the-go reporting using its interactive feature. It has versatile visualizations that en
    4 min read
  • Scatter and Bubble Chart Visualization in Excel
    Scatter Charts and Bubble Charts display many related data in one Chart. In both of these charts, the X - axis displays one numeric field and the Y-axis displays another. It helps to specify the relationship between two values for all the items in the chart easily. In Bubble charts, a third numeric
    5 min read
  • What is a Cell in Excel?
    MS-EXCEL is a part of Microsoft Office suite software. It is an electronic spreadsheet with multiple rows and columns, used for organizing data and performing different calculations. A spreadsheet takes the shape of a table, consisting of rows and columns. A cell is created at the intersection point
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences