logo
Microsoft Excel - Interview Questions and Answers
What is the purpose of Data Validation in Excel?
What is Data Validation in Excel?

Data Validation in Excel is a feature that helps control and restrict the type of data entered into a cell. It ensures accuracy and consistency by allowing only predefined values or formats.


Purpose of Data Validation

* Prevent Invalid Data Entry – Restrict users from entering incorrect values.
* Ensure Data Consistency – Standardize inputs like dates, numbers, or text formats.
* Improve Data Entry Efficiency – Guide users with dropdown lists or error messages.
* Enhance Accuracy – Minimize errors in calculations and reports.

How to Apply Data Validation
  1. Select the Cell(s) or Range
    • Click on the cell(s) where you want to apply validation.
  2. Open the Data Validation Menu
    • Go to the Data tab → Click Data Validation in the "Data Tools" group.
  3. Choose Validation Criteria
    • Under the Settings tab, select from different validation types:
      • Whole Number (Restrict to whole numbers only)
      • Decimal (Allow only decimal values)
      • List (Create a dropdown menu)
      • Date (Restrict to specific date ranges)
      • Time (Set allowed time frames)
      • Text Length (Limit characters in text)
      • Custom (Use formulas for complex rules)
  4. Set Conditions
    • Enter the allowed range or values (e.g., min/max for numbers, a date range, etc.).
  5. Add Input Message (Optional)
    • Under the Input Message tab, provide instructions that appear when users select the cell.
  6. Add an Error Alert (Optional)
    • Under the Error Alert tab, customize a warning message if users enter invalid data.
  7. Click OK to Apply.


Examples of Data Validation
1. Create a Dropdown List
  • Select cells (A1:A10).
  • Open Data Validation → Choose List.
  • Enter values like:
    Apple, Banana, Orange
    
  • Click OK → A dropdown menu will appear in the selected cells.
2. Restrict Numbers Between 1 and 100
  • Select a cell.
  • Open Data Validation → Choose Whole Number.
  • Set Minimum: 1, Maximum: 100.
  • Click **OK`.
3. Restrict Dates to a Specific Range
  • Select a cell.
  • Open Data Validation → Choose Date.
  • Set the start date as 01/01/2024 and the end date as 12/31/2024.
  • Click OK.
4. Allow Only Email Format (Using Custom Formula)
  • Open Data Validation → Choose Custom.
  • Enter formula:
    =ISNUMBER(SEARCH("@", A1))
    
  • Click OK → Only entries containing "@" will be allowed.

How to Remove Data Validation
  1. Select the cell(s).
  2. Go to DataData Validation.
  3. Click Clear AllOK.