Date calculation
How to Use?
In the formula calculation, you can use the «Date and Time» element. This can be useful in cases when you need to calculate the number of days between the selected date and the current date, or find out the number of days between two dates.
Initially, the variable uses the value equal to the difference between the selected date and the current date. For example, the current date is July 17, 2023, and the selected date is July 19, 2023. As a result, the variable will have the value «2», as the selected date of July 19, 2023 will be subtracted from the current date of July 17, 2023.
Calculation Between Two Fields with Dates
To calculate the difference between two dates, you need to use the mathematical function abs. To do this, go to the formula editor and click on the«Advanced Mathematical Functions» icon and select the abs (x) function.
Use the function insertion or manual input to place the following type of formula:
abs(abs (D1) - abs(D2))
Variables D1 and D2 are the «Date and Time» elements placed in your form builder. As a result, upon selecting dates, the difference in days between them will be obtained.
This formula value can be used in further calculations. For example, for calculating the cost of renting a property by multiplying the formula value R1 by a coefficient.