Skip to main content
Solved

Remove NaN in a countdown date field


Hi There! I have a series of tasks with deadlines. The field next to “Deadline” is a countdown titled "Days Left’ with the amount of days left until the task is due. However, I don’t yet have/need deadlines for some of the tasks, so the Deadline field is sometimes empty which results in NaN.

The formula I used for “Days Left” is DATETIME_DIFF(Deadline, TODAY(), ‘days’)

I’ve tried a few different IF formulas to remove NaN but I keep getting errors. Can anyone help me out here?

Best answer by Jason11

Welcome to the community @Kathryna_Hancock!

You can use an IF statement to only run your existing formula if there is a date in the Deadline field. Here’s how that should look:

IF(Deadline, DATETIME_DIFF(Deadline, NOW(), 'days')) 

Notice that I also switched out TODAY() with NOW() because NOW() uses the exact current day and time, while TODAY() defaults to the current day at 12:00am.

You can also find more tips on troubleshooting common formula errors like NaN here: https://support.airtable.com/hc/en-us/articles/360034619694-Common-formula-errors-and-how-to-fix-them

View original
Did this topic help you find an answer to your question?

3 replies

  • Inspiring
  • 375 replies
  • Answer
  • February 27, 2020

Welcome to the community @Kathryna_Hancock!

You can use an IF statement to only run your existing formula if there is a date in the Deadline field. Here’s how that should look:

IF(Deadline, DATETIME_DIFF(Deadline, NOW(), 'days')) 

Notice that I also switched out TODAY() with NOW() because NOW() uses the exact current day and time, while TODAY() defaults to the current day at 12:00am.

You can also find more tips on troubleshooting common formula errors like NaN here: https://support.airtable.com/hc/en-us/articles/360034619694-Common-formula-errors-and-how-to-fix-them


Thank you! That worked!


  • Inspiring
  • 375 replies
  • February 27, 2020
Kathryna_Hancoc wrote:

Thank you! That worked!


You’re welcome @Kathryna_Hancock!


Reply