To keep your spreadsheet from accepting invalid data, you can define a cell to accept only certain types of data, such as numbers that fall between 30 and 100. The moment someone tries to type invalid data into a cell, Excel immediately warns you, as shown in Figure below.
Excel warns you if you type invalid data in a cell.
To define valid types of data for a cell, follow these steps:
- Click a cell that contains data used by a formula.
- Click the Data tab.
- Click the Data Validation icon in the Data Tools group.
The Data Validation dialog box appears, as shown in Figure below.
Define the type and range of acceptable data allowed in a cell. - Click the Allow list box and choose one of the following: Any Value: The default value accepts anything the user types
Click the Input Message tab in the Data Validation dialog box, as shown in Figure shown below. - Click in the Title text box and type a title.

The Input Message tab lets you display a message explaining the type of valid data a
cell can hold. - Click in the Input Message text box and type a message you want to display when someone selects this particular cell.
- Click the Error Alert tab in the Data Validation dialog box, as shown in Figure below.
- Click the Style list box and choose an alert icon, such as Stop or Warning.
- Click in the Title text box and type a title for your error message.

Define an error message to show if the user types invalid data into the cell. - Click in the Error Message text box and type the message to appear if the user types invalid data into the cell.
- Click OK.
Whole Number: Accepts only whole numbers, such as 47 and 903
Decimal: Accepts whole and decimal numbers, such as 48.01 or 1.00
List: Allows you to define a list of valid data
Date: Accepts only dates
Time: Accepts only times
Text length: Defines a minimum and maximum length for text
Custom: Allows you to define a formula to specify valid data
Depending on the option you choose, you may need to define Minimum
and Maximum values and whether you want the data to be equal to, less
than, or greater than a defined limit.
After you define data validation for a cell, you can always remove it later. To remove validation for a cell, follow these steps:
- Click in the cell that contains data validation.
- Click the Data tab.
- Click the Data Validation icon in the Data Tools group. The Data Validation dialog box appears.
- Click Clear All and then click OK.
- Excel clears all your data validation rules for your chosen cell.


















