FormulaCraft

How to restrict cell input to a date range in Excel and Google Sheets

Excel & Google Sheets
=AND(A2>=B$1, A2<=C$1)

Verified example

Computed by a real spreadsheet engine on the sample data below.

Start DateEnd DateInput Date
2023-01-012023-12-312023-06-15

=AND(A2>=B$1, A2<=C$1)FALSE

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Select the cell or range where you want to restrict date input.
  2. 2Go to Data > Data Validation in Excel or Data > Data validation in Google Sheets.
  3. 3Set the criteria to 'Date' and specify the minimum and maximum dates in the respective fields.
  4. 4Click OK to apply the settings.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

What happens if a user enters a date outside the allowed range?

The user will receive an error message and won't be able to proceed until they enter a valid date.

Can I use this method to restrict times as well?

Yes, by setting the criteria to 'Time' instead of 'Date', you can restrict time inputs similarly.

Is there a way to allow multiple date ranges?

No direct support for multiple date ranges, but you can use custom formulas with AND/OR logic to achieve this.

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: