I want to use a formula to calculate the age of a product
DATETIME_FORMAT(TODAY(),‘YYYY’) - {year produced}
Some fields of {year produced} are empty, so the formula comes back as the age of 2022 years old. Is there some way to exclude the empty {year produced} fields? The year produced, has the number field type.
Note that I am using YEAR() instead of DATETIME_FORMAT() This is because YEAR() returns a number, whereas DATETIME_FORMAT() returns a text string. In this case, Airtable is converting that text string into a number for you, so the math still works. However, it is still good practice to avoid mixing text strings and numbers when doing math.