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.

## 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 editor you can then insert the **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 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.

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**.

**column names**in the table are displayed on the left side of the

**formula editor**and can be inserted into the formula with a

**double-click**.

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.

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