To add a date restriction in Excel data validation, select the cells, go to Data > Data Validation, choose Date under Allow, then set the start and end dates (or use formulas for dynamic ranges). This restricts entries to valid dates, preventing typos or out-of-range values. You can also use a list of specific dates, but the date option is most common. Here’s the full walkthrough.
What You’ll Need
- Microsoft Excel (desktop for Windows or Mac, or Excel for the web). Steps are for Microsoft 365 on Windows; differences noted.
- A worksheet with a column or range where you want date entry restricted.
- Optional: a cell containing a formula for dynamic start/end dates (e.g.,
=TODAY()).
Step-by-Step
- Select the cells where you want the date restriction. This can be a single cell, a column, or a non-contiguous range (hold Ctrl while clicking).
- Go to the Data tab on the ribbon. In the Data Tools group, click Data Validation. (On Mac, it’s under the Data menu > Data Validation.)
- In the dialog box, click the Settings tab (it’s the default).
- Under Allow, click the dropdown and select Date.
- Under Data, choose the comparison type. The most common is between, but you can also pick greater than, less than, equal to, etc.
- Now set the dates. You have two options:
- Fixed dates: Type the start date in the Start date box and the end date in the End date box (e.g.,
1/1/2025and12/31/2025). Excel recognizes most date formats. - Dynamic dates: Instead of typing, click the cell reference icon at the right of a box, then click a cell that contains a date or a formula. For example, if cell
E1has=TODAY(), you can set the start date to=E1to allow only today or later (if you choose greater than or equal to).
- Fixed dates: Type the start date in the Start date box and the end date in the End date box (e.g.,
- Click OK. Now, if someone types a date outside the range, Excel shows a warning (unless you customize it).
- To add an input message (so users know what to enter), go to the Input Message tab, check “Show input message when cell is selected,” and type a title and message like “Enter a date between 1/1/2025 and 12/31/2025.”
- To add a custom error alert, go to the Error Alert tab, check “Show error alert after invalid data is entered,” choose a style (Stop, Warning, Information), and type a title and error message.
- Click OK again to apply all settings.
Common Mistakes
- Using text dates: Typing dates like “Jan 1, 2025” might be interpreted as text. Use a recognizable date format like
1/1/2025or use the DATE function, e.g.,=DATE(2025,1,1). - Forgetting to set the “Data” condition: If you leave “Data” as “between” but only fill one date box, Excel may error. Always fill both start and end when using “between.”
- Applying validation to merged cells: Data validation doesn’t work well on merged cells. Unmerge or apply to the range before merging.
- Copying cells with validation: If you copy a cell with validation and paste over other cells, the validation is replaced. Use Paste Special > Validation to copy only the validation rule.
- Using whole column references (e.g., A:A) in older Excel: This can cause performance issues. Use a specific range like A2:A100 unless you need the whole column.
Tips
- Use dynamic formulas for rolling ranges: For a date range that updates automatically, use formulas like
=TODAY()for the start and=TODAY()+30for the end. This allows only the next 30 days. - Create a named range for dates: If you want to allow a specific list of dates (e.g., holidays), use the “List” option in Allow and reference a range like
=HolidayDates. - Use the DATE function for clarity: Instead of typing
1/1/2025, use=DATE(2025,1,1)to avoid regional date format ambiguity. - Apply validation to entire columns: Select the entire column (e.g., click the column header) before setting validation to cover all future entries.
- Test your validation: After setting, try entering a valid and an invalid date to see if the error alert appears.
Troubleshooting
Validation doesn’t work when typing a date: Check that the cell is not formatted as Text. Select the cell, go to Home > Number Format, and choose a date format. Also, make sure the validation is applied to the correct range.
Error message doesn’t appear: The Error Alert may be set to “Information” or “Warning” which allows entry. Go to Data Validation > Error Alert and set the style to “Stop” if you want to block invalid entries.
Validation disappears after copying/pasting: When you paste data into cells with validation, the validation is overwritten. Use Paste Special > Values to paste only the value, or reapply validation after pasting.
Dates are not recognized as dates: If you type a date and it aligns left (text), Excel isn’t treating it as a date. Use the DATEVALUE function to convert, or re-enter with a proper date format.
Validation doesn’t work on Excel for the web: Basic date validation works, but dynamic formulas like =TODAY() in validation may not be supported in all cases. Test in the web version; if it fails, use fixed dates or apply in desktop Excel.
Frequently Asked Questions
Can I set a date validation to only allow weekdays? Yes, use a formula with the WEEKDAY function. In the Data Validation dialog, choose “Custom” under Allow, and enter a formula like =WEEKDAY(A2,2)<6 (assuming A2 is the active cell). This allows Monday-Friday.
How do I make the date validation automatically update to current year? Use formulas in the start and end boxes, e.g., =DATE(YEAR(TODAY()),1,1) for Jan 1 of the current year and =DATE(YEAR(TODAY()),12,31) for Dec 31.
Can I use data validation to create a dropdown calendar? Not directly. Data validation creates a dropdown list, but for a date picker you need a third-party add-in or use the built-in calendar control in ActiveX (Windows only). For most users, typing with validation is sufficient.
Why does my date validation allow text entries? Data validation with “Date” only checks if the entry is a valid date. If you type text, it will be rejected (unless you set the error style to Warning/Information). If text is being accepted, ensure the cell is not formatted as Text and that the validation is set to “Date” not “Any value.”
Can I copy data validation to other cells? Yes. Select the cell with validation, press Ctrl+C (or Command+C on Mac), then select the target cells, right-click and choose Paste Special > Validation.
How do I remove data validation? Select the cells, go to Data > Data Validation, click “Clear All” at the bottom, then OK.
Related
- What Are My Data Limits? A Complete Guide
- Random 3 Digit Number: How to Generate One
- Max Data Entry Services LLP: What It Is & How It Works
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Degree Audit Excel Template: Build a Clear Credit TrackerA degree audit Excel template is a workbook for comparing completed and planned coursework with degree requirements. You…
- How to Create a Second Page of Address Labels in WordTo create a second page of address labels in Word, copy the label table from the first sheet,…
- Stampin’ Up Inventory Spreadsheet: What to TrackA Stampin’ Up! inventory spreadsheet is a practical way to track the paper, stamps, ink, tools, and other…
- Data Entry Pay: Hourly Rates & Salaries in 2024Data entry pay averages between $15 and $20 per hour for most full-time positions in the United States,…
- Google Sheets Can’t Open Apps Script? Fixes That WorkYes—Google Sheets can open Apps Script in a web browser: open the spreadsheet and choose Extensions > Apps…
- Google Sheets COUPNCD Function ExplainedThe COUPNCD function in Google Sheets calculates the next coupon (interest payment) date after a given settlement date…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.