Date Difference using dateDif formula

Hi,

I have a table that has a column for entering a date, called “Started:”, and then I have another column which I want to use “dateDif” to work out the number of days between todays date and the date in “Started:” column.

I have tried to use this formula: dateDif(today(), {Started}, “D”) but it shows me “#num” in that column instead. Am I doing something wrong or is this way of doing it not yet available?

Hi, the datedif() function works only when the startDate is before the endDate. So if your {Started} date is in the future, you can get the desired result!

Now that you get #NUM you should consider switching today() and {Start}:

datedif({Started}, today(), 'd')

Ah yes, that seemed too obvious. Thank you @Karlheinz

You are welcome!

One more kind reminder, since you are using the today() function: It is updated everyday, because it’s always today. Each time you use SeaTable, it retrieves the current date and updates the value of today(). This would be a great feature if you use it to make some kind of count-down.

Thanks, that is what I need it for. I wish to know how many days have elapsed since the project was started. So having today() tracking the current date is perfect.

Hi,
in the same logic considerations, how is it possible to compare dates in formulas ?
Something like :
ifs({Estimated-end(date}<{Real-closure-date},“project was late”, {Estimated-end(date}>{Real-closure-date},“project was closed before target date”)

EDIT: I’ve found networkdays({Date1},{Date2}) that works in both direction, but that’s only for open days, right ? any possible formula to have the same with all days ?