Nov 30, 2015
Data Validation is a feature of Excel that can greatly improve the quality of data that is entered into cells by limiting what a user can type. You can create simple rules using the Data Validation dialog box’s user-friendly menu options, but what if they aren’t’ enough?
Custom Data Validation rules involve using a formula to determine what is and isn't valid. For example, what if you want to limit cell A1 to just 4 digit numbers (eg a postcode cell)? You would need to ensure that:
- The cell only allows 4 characters
- The characters must be digits
The formula would read: =AND(LEN(A1)=4,ISNUMBER(A1))
To break it down:
- LEN(A1) refers to the length of the entry so LEN(A1)=4 says the length must be 4 characters
- ISNUMBER(A1) says that the contents of A1 are a value (ie a number)
- The AND() function simply means that the above two points must be true
To create the rule, follow the steps outlined below:
- Select the cell or cells you want to apply the rule to
- Select the Data tab on the Ribbon
- Click the Data Validation button
- From the Allow drop-down list, choose Custom
- Enter the formula
- Click OK
For more on Excel’s features, see New Horizons' Microsoft Excel training courses.
How do your Excel skills stack up?
Test NowNext up:
- Using the Fluent API with Entity Framework
- Embedding Organisational Values into Performance Management
- Hide Parts of a Page from Certain Users in SharePoint
- Combining different chart types in Excel 2013
- Intro and setup for Xbox SmartGlass
- My mate Stevo said it was good and Norm just couldn’t wait his turn!
- Difference between ByVal and ByRef in VBA
- Fiddly actions with Word tables
- Windows as a Service – The new Update Model
- A Recipe for Frame Fun with InDesign CC
Previously
- Using a Calendar on your Website
- Ever typed a date into Excel and it turned into a number?
- What is ITIL?
- The best features of Excel 2013 – Part 1
- Why effective leadership is like yogurt
- AngularJS Service – The Basics
- The Quick Brown Fox…
- Customise the navigation drop-down in SharePoint
- From Rivals to Friends … The rise of a new behemoth – The Red Microsoft Hat.
- Is your ‘Human Capital’ stock going up or down?