This is a common question from Google Forms users who work around the month end. For example, if you charge for part of a month, you need to know how many days are left in it. That number changes every day and it depends on the month. Google Forms has no way to work it out, so you do it by hand. With Formfacade, you can calculate the days in the month using the DATE function and then subtract the current day of the month, so your users see the days remaining. Even better, the form works it out again every day, so you never have to update it.
Let's start. Create your form and follow the steps below.
- On the page that opens, name your form, click Build form and click Proceed. It can take about a minute.
- You will land on the form's "Preview" tab.
- Click on "Edit" tab
- Click on the + icon (Add field) in the toolbar on the right. A new question will be added.
- Enter "Number of days in this month" as the question. It is already a Short answer.
Click on the ⚙️ icon at the bottom right of the question.
Field settings screen will be displayed. Select the "Answer" tab and write the formula to calculate the days in this month.
The first step is to calculate the last date of this month. We can pass the year, month and day to the date function.
TODAY().year() will return the current year
TODAY().month() will return the current month
DATE(TODAY().year(), TODAY().month()+1, 1) will return the first day of next month.
We can then use the SUBTRACT function to find the last day of this month.
DATE(TODAY().year(), TODAY().month()+1, 1).subtract(1,"days")
There is another way to calculate the last day of this month without using the SUBTRACT function.
DATE(TODAY().year(), TODAY().month()+1, 0) will return the last day of this month.
We can use the getDate() or date() function to find the day of the month for a specified date.
DATE(TODAY().year(), TODAY().month()+1, 0).date() will return the last day of the month.
Write the above formula in the Calculate option as shown below. Click Save.
- Click on the + icon (Add field) in the toolbar on the right. A new question will be added.
- Enter "Number of days remaining in this month" as the question. It is already a Short answer.
Click on the ⚙️ icon at the bottom right of the question.
Field settings screen will be displayed. Select the "Answer" tab and write the formula to calculate the days remaining in this month.
We can use the getDate() or date() function to find the day of the month for a specified date. TODAY().date() will return the current day. To calculate the remaining days in the month, we can use the below formula.
DATE(TODAY().year(), TODAY().month()+1, 0).date() - TODAY().date()
Since we have already calculated the number of days in this month as an answer for a question in the form, we can refer that instead of writing the formula again.
days_in_this_month - TODAY().date()
Note: To enter days_in_this_month, type @ in the calculate option and select the number of days in this month question from the list. If no list appears on your form,
make your form here instead: name it, click Create form and click Proceed, close the Assign points dialog and add these questions. The @ list opens on a form made there.
Write the above formula in the Calculate option as shown below. Click Save.
The form now shows the days in this month and the days remaining.
If you need the days left in a month, Google Forms cannot calculate them. With Formfacade, you can write the DATE and TODAY formula in the Calculate option and the form will show the days in the month and the days remaining.
Create your form and complete the steps above. If you have any questions,
write to support.