Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

DATETIME_DIFF doesn't work

Topic Labels: Formulas
450 1
cancel
Showing results for 
Search instead for 
Did you mean: 

Hello,
I’m dealing with DATETIME_DIFF. It worked until today, but now it return “NaN”, what’s happen?

1 Reply 1

Hi @MATTEO_TONDO - the formula itself is working OK, but I suspect you have an issue in the formula configuration or in the data you are inputting to the formula. If one or both of the date fields is empty, then it will return NaN

Screenshot 2020-05-13 at 14.38.58

You can get around this by testing for the presence of both dates first:

IF(AND({Date 1}, {Date 2}), DATETIME_DIFF({Date 1}, {Date 2}, 'days'))

which gives this:

Screenshot 2020-05-13 at 14.41.49

JB