Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Remove NaN in a countdown date field

Topic Labels: Formulas
Solved
Jump to Solution
1448 3
cancel
Showing results for 
Search instead for 
Did you mean: 

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?

1 Solution

Accepted Solutions

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

See Solution in Thread

3 Replies 3

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

Thank you! That worked!