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

Removing NaN from DATETIME-DIFF

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

I’ve found similar forums, but when I try to apply what I’m seeing to my table it’s not working so I’m missing something obvious :woozy_face:

Looking to have this formula DATETIME_DIFF(Completion, KickOff, ‘days’) only run when the completion and kickoff fields are filled out to avoid the NaN result.

Appreciate any help!


1 Reply 1

Great question :slightly_smiling_face: I always advise wrapping calculations dealing with dates with an IF() statement to avoid errors/a result of NaN. In the case of DATETIME_DIFF(), you’ll want to use AND(), as well.

Try this:

IF(AND({Completion}, {Kick Off}), DATETIME_DIFF({Completion}, {Kick Off}, 'days'))