Thursday, February 21st, 2013

Google Docs: Data Validation

Google Docs has the ability to use data validation to automate and manage data entry into cells in a spreadsheet. One way to do this is to limit the data that can be entered into a cell to a selection from a list that you create.

To see this at work, open an existing spreadsheet or create a new one. Select the cells into which the data will go and choose Data > Validation. From the Criteria dropdown list, select Items From a List and then click Enter List Items. Type each item for your list into the box separating entries from each other with a comma. Make sure the “Show list of items in a drop-down menu” is checked and if you don’t want a user to select anything that’s not in the list, then disable the “Allow invalid data, but show warning” checkbox. Click Save to save the validation options.


Now, when you enter data into any of the cells in the range you have configured this data validation rule for, you will see a dropdown indicator appear to the right of the cell. Click this and you can select an item from the list that is displayed below the cell. This data is entered into the cell in the same way as any data would be entered so you can, for example, use it in calculations by referring to the cell contents. In the example worksheet shown, a formula is used the cells in column C to calculate the converted value by checking what currency has been chosen and then multiplying the value in column A by the appropriate conversion rate.

It’s also possible to use other validation options using the Data Validation dialog. You can limit a cell entry to a number which meets certain criteria or to a text entry that contains or does not contain certain text or which is a valid email address or URL. You can also require that a date is entered within a certain range of dates or before or after another date.

You can force a user to comply with the data validation rules that you have created or allow them to enter an “invalid” value but warn them that they are about to enter data that doesn’t comply with the rule.

These data validation tools available in Google Docs are similar to those that you’ll find in other spreadsheet applications such as Excel.

Helen Bradley

Friday, February 23rd, 2007

Excel – trapping invalid data

There’s a term that I love called GIGO – garbage in garbage out. When you’re designing an Excle worksheet to solve a business problem you need to make sure that your data is correct or your worksheets won’t give valid results.

Luckily, Excel’s Data Validation tool helps you prevent incorrect data being added into your worksheet.

To set up a validation rule and to configure what will happen if incorrect data is entered, start by selecting the cells to which the rule should apply. Choose Data, Validation, Settings tab. Now, for example, to limit the data being entered to a whole number less than 200, select whole number from the Allow drop down list. When the Data area appears, choose Less Than and then in the Maximum area type 200.

To configure a user message to tell the user what is required, click the Input Message tab and type a title and a piece of explanatory text telling the user the limits to the type of Data you’re expecting them to enter. This appears as a tooltip entry when any of the cells configured with the data validation rule is selected.

You can also specify what should happen if a user enters an incorrect value. To do this, click the Error Alert tab and select the type of indicator from the Style list. If the user enters incorrect data and if you have chosen the Stop style they will have two choices – Retry and Cancel and the invalid data cannot be entered into the cell. The Warning and Information styles both warn about the incorrect data but still allow it to be entered.

Once you’ve chosen the style, enter the Title and the Error Message which the user will see if the data in not correct. Click Ok and you can now test the rule.

Helen Bradley