Welcome to our next lesson on preparing and cleaning data in Excel. In our previous session, you mastered the Advanced Filter, a powerful tool for extracting specific records from large datasets based on complex criteria. You learned how to find the exact data you need. Now, we'll shift our focus from finding existing data to controlling new data as it's entered.
This lesson introduces Data Validation, a fundamental feature for ensuring data quality and integrity. You will learn how to implement rules that restrict what users can type into a cell. This skill is essential for a freelancer, as it allows you to build robust, error-proof spreadsheets and tools for your clients, minimizing mistakes and the need for time-consuming cleanup later. We will cover setting rules for numbers and text, creating user-friendly drop-down lists, and providing helpful messages to guide input.
What is Data Validation?
Data validation is a feature in Excel that allows you to control the type of data or the values that users can enter into a cell. Think of it as setting up a gatekeeper for your cells. If the data being entered doesn't meet the rules you've set, Excel can either block the entry, show a warning, or simply provide an informational message.
This feature is managed through a dialog box with three key tabs:
- Settings: This is where you define the validation rule itself (e.g., "only allow whole numbers between 1 and 100" or "only allow values from this list").
- Input Message: This optional tab lets you create a pop-up message that appears when a user selects the cell, guiding them on what to enter.
- Error Alert: This tab defines the message a user sees after they try to enter invalid data.
Excel Data Validation Guide | Exceljet
This guide from Exceljet provides a great introduction to the concept and its main controls.
Please read the section that introduces the three tabs of the data validation window. Start at this section to familiarize yourself with the Settings, Input Message, and Error Alert tabs.
Applying Basic Validation Rules
Let's start by applying some common validation rules. We can restrict cells to accept only certain types of data, like whole numbers, dates, or text of a specific length.
The video "MS Excel - Data Validation" by TutorialsPoint offers a practical walkthrough of setting up these basic rules.
Please watch the following segments: Whole Numbers: Observe how to restrict a cell to accept only whole numbers between a minimum and maximum value. Text Length: See how to limit the number of characters that can be entered. Dates: Learn how to enforce a specific date range for cell entries.
As you can see, the Settings tab is where you configure these rules. You select the data type you want to allow (Whole Number, Date, etc.) and then provide the specific conditions (between, greater than, etc.).
Creating Drop-down Lists
One of the most practical applications of data validation is creating a drop-down list. This prevents spelling mistakes and limits choices to a predefined set of options, which is incredibly useful when building forms or templates.
There are two primary ways to create a list:
- Manual List: You can type the list items directly into the validation settings, separated by commas. This is quick for short, static lists.
- From a Range: You can reference a range of cells in your worksheet that contains the list items. This is the more robust and common method, as it's easier to update the list by simply changing the values in the source range.

Let's see how both methods are implemented.
We will continue with the same video to see how drop-down lists are created.
Please watch the segment from this section on lists. Pay attention to both methods: typing the list manually and, more importantly, creating a list from a source range on the worksheet. The video also gives a crucial tip about what happens if the source data is deleted and how you can protect it.
Guiding the User: Input Messages and Error Alerts
Setting a rule is one thing, but making it understandable for the user is another. This is where Input Messages and Error Alerts come in.
- An Input Message is a proactive prompt. It appears when a user selects a cell, telling them what is expected before they type anything.

- An Error Alert is a reactive message. It appears after a user tries to enter invalid data. You can customize the title and text of this message to be more helpful than Excel's default.
More importantly, you can choose one of three "styles" for your error alert, which control how strictly the rule is enforced:
- Stop: This is the strictest level. It physically prevents the user from entering invalid data. They must either correct their entry or cancel.
- Warning: This style warns the user that the data is invalid but gives them the option to override the warning and enter the data anyway.
- Information: This is the most lenient style. It informs the user the data is invalid but lets them accept it by simply clicking OK.
Choosing the right style depends on the situation. For critical identifiers or financial categories, Stop is usually best. For things like notes or optional fields where guidelines are helpful but not mandatory, Warning or Information may be more appropriate.
MS Excel - Data Validation Error Alert
The video "MS Excel - Data Validation Error Alert" provides a focused look at creating these user-facing messages.
Watch the following segments to understand these features: Input Message: This shows how to set up the helpful prompt that appears when a cell is selected. Error Alerts: This is the most important part. Pay close attention to the demonstration of the three different styles: Stop, Warning, and Information, and note how the user's options change with each one.
An Important Limitation and Advanced Validation
Data validation is a powerful tool for guiding users, but it's not foolproof. It's important to know that if a user copies data from a cell without validation and pastes it into a cell with validation, the validation rule is overwritten and destroyed. It's a "best practice" tool for improving data quality, not a security feature.
For more complex scenarios, you can use the Custom option in the validation settings to write your own formula. For example, you could write a formula to ensure an entry is a unique value in a column or that it follows a specific text pattern (like a product ID). We won't dive deep into custom formulas today, but you can see some powerful examples in the Microsoft Support article below.
Apply data validation to cells - Microsoft Support
This official Microsoft article is a great reference. We'll look at the advanced examples.
Skim the table at the end of the article under the heading "Custom option". This will give you a sense of the complex rules you can create with formulas, a skill you can develop as you become more advanced.
Conclusion
In this lesson, you've learned how to proactively manage data quality using Excel's Data Validation tools. This is a critical step in building reliable and user-friendly spreadsheets for your future clients.
Here are the key takeaways:
- Data Validation controls what can be entered into a cell, helping to prevent errors at the source.
- You can set rules for various data types, including numbers, dates, and text length.
- Drop-down lists are a powerful way to guide user input and prevent typos by providing a predefined set of choices.
- Input Messages provide guidance to users before they enter data, while Error Alerts inform them when they've made a mistake.
- Error alerts have three styles—Stop, Warning, and Information—that determine how strictly a rule is enforced.
In our next lesson, we will continue our focus on data quality by learning how to remove duplicate records from a dataset. This, combined with what you've learned today, will give you a solid foundation for cleaning and preparing data for analysis.