How to validate if the date entered by the user falls within a date range?

Google Forms does not support response validations for date questions. The workaround is to add a short answer question with the required response validations and add the date range calculations in Formfacade.

Google Forms does not support response validations for date questions. The workaround is to add a short answer question with the required response validations and add the date range calculations in Formfacade.

Date validation: Specified date range

Let's take a simple example. Deliveries are available from 25th Sep till 1st October. Users can choose their preferred delivery date between these two dates. Since Google Forms does not have the option to add response validations for date questions, we cannot implement this in native Google Forms. Please follow the instructions below to implement the workaround using Formfacade.

Step 1: Add a short answer question in Google Forms.
Step 2: Click on the ⋮ icon and select Response validation. Add a regular expression matches pattern validation. The acceptable answer for this question is "Yes". Otherwise, it will show a custom error message "Delivery not available for the selected date".
Step 3: Click on the Addon icon > Select Formfacade > Select Customize this form > Click on the Proceed button.
In the Formfacade customize interface, click on the ⚙️icon next to the short answer question for date range validation.
Step 4: Field settings screen will be displayed. Select the "Answer" tab and write the formula to validate the date and set the value for the short answer question for delivery available?

Using IFS condition to set the valid response

Deliveries available from 25th Sep till 1st October. We can use the DATE function with logical AND operator to validate the date range. The syntax for the date function is DATE(year, month, day)

25th September 2020 = DATE(2020,9,25)
1st October 2020 = DATE(2020,10,1)

AND (&&) operator can be used to combine multiple validations. The required date range validation is
selected_date > DATE(2020,9,25) && selected_date <= DATE(2020,10,1)

IFS function evaluates multiple conditions and returns a value that corresponds to the first true condition. We will use the IFS function to check if the selected date falls between 25th September and 1st October. If true, set the answer as "Yes". Otherwise, set the answer as "No".

IFS(selected_date > DATE(2020,9,25) && selected_date <= DATE(2020,10,1),"Yes","No")

Note: To enter selected_date, type @ in the calculate option and select the choose your preferred date question from the list.

Step 5: Write the above IFS formula in the Calculate option as shown below.
Made with formfacade