Restrict Cells to Accept Only Dates Using Data Validation
In this blog post we will learn to restrict the cells to accept only dates with the help of “Data Validation” functionality in excel.
5. By entering the above values click on “OK” button and with this we can restrict the Dates in selected cell “A5”.
6. If we try to enter the dates beyond the given date range then excel will throw an error as shown in below image.
For example, we want to ask user to enter the date in highlighted cell but the condition is that the entered date should be between “Date 1” and “Date 2”. If user enters any other date beyond this range then the highlighted cell should not accept it.
For this we will use “Data Validation” functionality in excel. “Data Validation” can be found in “Data” tab under “Data Tools” group.
Now let’s see how we can use this “Data Validation” command to restrict cell to accept only dates:
1. Select the cells in which we wish to restrict the date. In this case we want to restrict text date in cell “A5”.
2. Click on Data Validation command under “Data Tools” group which will appear 03 further options and out of these 03 options again select “Data Validation”.
3. Once we click on “Data Validation” command, one dialog box named as “Data Validation” will appear on screen.
4. Under this dialog box, click on “Settings” tab and select the values in respective fields as shown below:
a. Allow: Date
b. Data: Between
c. Start Date: Enter formula as “=B1” (As we have entered Start Date in cell B1)
d. End Date: Enter formula as “=B2” (As we have entered End Date in cell B2)
More Criteria’s to restrict Cell to Accept Only Dates:
In above example, we have seen only one criteria to restrict cell to accept only dates. There are some additional criteria’s available in excel by using which we can restrict the dates in a cell.
These additional criteria’s are as listed below:
1. Between: With this option we can restrict cell to accept dates which are between provided two dates.
2. Not between: With this option we can restrict cell to accept dates which is not between provided two dates.
3. Equal to: With this option we can restrict cell to accept dates which is equal to provided date.
4. Not equal to: With this option we can restrict cell to accept dates which is not equal to provided date.
5. Greater than: With this option we can restrict cell to accept dates which is greater than provided date.
6. Less than: With this option we can restrict cell to accept dates which are less than provided date.
7. Greater than or equal to: With this option we can restrict cell to accept dates which are greater than or equal to provided date.
8. Less than or equal to: With this option we can restrict cell to accept dates which are less than or equal to provided date.
In this way we can restrict cell to accept dates in excel with the help of various options.
Comments
Post a Comment