I know how to test for the presence or absence of a value in another field, e.g.
IF( MiddleName != BLANK()....
But it does not seem to work with a field that should return a number result, when the parameter being fed to the formula is empty. Here’s what I think is the standard Airtable formula for an Age calculation:
DATETIME_DIFF(TODAY(),DOB,'years')
Works great so long as there is a date in the DOB field. If DOB is empty, on the other hand, this formula returns “NaN” (“Not a Number”). That’s ugly. So I tried
IF(DOB!=BLANK(),DATETIME_DIFF(TODAY(),DOB,'years'),BLANK())
But get the same result. Apparently BLANK() isn’t a number value. This wouldn’t be a problem in FileMaker, but if it were, I could coerce the (empty) result to a (non) value of type Number. In FileMaker these are both valid expressions:
GetAsDate("")
GetAsNumber("")
But Airtable doesn’t have a way to do this does it? Something like
COERCE(BLANK(),Number)
Is there another way to get rid of the “NaN” result in my Age fields? (BTW this seems related to the issues with BLANK() discusssed in this long thread:
Blank() & Zero problem - Ask the community / Formulas - Airtable Community Forum

