SeaTable formulas offer you several ways to work with the data in your tables. One of them is to calculate the days until a future event or occurrence. For example, with the help of a corresponding formula you can automatically calculate the remaining days until a training, birthday or other event.
Calculate days until an event #
In the concrete example, the goal is to use a formula to calculate the days remaining until the recorded three events.
To do this, first add a formula column to the table, in whose text field you can then add any formula.
To calculate the remaining days until the events, first add the "dateDif" function to the formula, which you can find in the Formula Editor under the Date Functions tab.
Afterwards, you also add the "now" function to the formula, which you can also find under the Date functions tab. The function always returns the current date and is therefore essential to ensure that the remaining days until the events are always displayed from the current time.
In the formula, please be sure to close the parenthesis after the function, otherwise SeaTable will not recognize it as such.
In order to use the formula to calculate the remaining days until the events, you must refer to the column where the dates of the events are collected in your table.
It is especially important that the column name is surrounded by curly brackets, otherwise SeaTable cannot recognize from which data the remaining days are to be calculated.
Finally, add the calculation method to the formula, which decides in which format the remaining time until the events will be displayed afterwards. If you want the remaining time to be calculated in days, please add "D" (days) to the formula.
Before confirming, it is important to note that the parenthesis must be closed for the formula to be accepted as valid.
After confirming the entered formula, the remaining days until the events are calculated and automatically added to the formula column of your table.