Thursday, August 20, 2009

Validating Data in a Sheet

To avoid having incorrect data in your sheets, you can define some validations on the data you have. Whenever these values are modified or a new data is entered, the validation would be performed. This allows you to keep a check on users entering invalid data.

To use any of the excel provided validations of your data, use the option Data --> Validation…

Suppose, you are making a list of things to carry on your next adventure trip which looks something like the one shown below:
Now, you want to have a validation that the field ‘Quantity’ can only contain whole numbers, Select the cell range where you want to apply this validation and click on Data --> Validation… Now, in the Validation Criteria in the ‘Settings tab’, choose ‘Whole Number’ for Allow, If you want to have more validation like quantity should be in a range or greater than some value, etc, you can select it appropriately.
In the ‘Input Message’ tab, you can enter any message that you want to show to the user when he/she selects the cell for which the validation is being applied.
If you want to show a message to the user when he/she enters a value in the cell which does not satisfy the validation criteria provided by you, then provide the appropriate message in the ‘Error Alert’ tab. This message could either stop the user from entering an invalid data or show it as a warning or information message,
Click on any of the cells on which you have applied the validation and you will see the input message.
Enter an invalid data and you will see the warning message.