Table of Contents

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. For example, with the help of an appropriate formula you can calculate the remaining days until a training, a birthday or another event.

In the concrete example, the goal is to use a formula to calculate the days remaining until the recorded three events.

Example table Calculate days until an event with a formula

To do this, first add a formula column to the table, in whose editor you can then insert the formula.

Adding a formula in the text field provided for this purpose

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.

Adding the “Date difference” function to the formula

Afterwards, you also add the “now” function to the formula, which you can also find in the date functions. 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, be sure to close the parenthesis of the function, otherwise it will not be recognized by SeaTable.

Adding the function “now” and closing the function with a bracket

In order for the formula to calculate the days remaining until the events, you must refer to the column where the date of the event is recorded. It is especially important that the column name is framed with curly brackets.

Adding the reference to the name of the table column where the event data can be found.

Finally, add the calculation methodology that will determine the format in which the remaining time until the events will be displayed. If you want to calculate the remaining time in days, add a “D” (for days) to the formula. Before confirming, you must close the parenthesis for the formula to be accepted as valid.

Exit the formula with the calculation methodology

After confirming the entered formula, the remaining days until the events are calculated and automatically displayed in the formula column of your table.

After confirming the formula, the remaining days will be automatically calculated and added to the formula column of your table.