Can anyone figure out what's wrong with this formula for age?


#1

IF({Sale Date}="",(DATETIME_DIFF({Sale Date},{Purchase Date},‘d’), (DATETIME_DIFF({Today’s Date},Purchase Date},‘d’))


#2

I miss 2 closing parentheses, from the DATETIME_DIFF. Also the second {Purchase Date} has no opening bracket.


#3

Didn’t work, but I found an alternate solution. It accepted my Datetime_diff if it were the 3rd item in the if statement, but not the second one.


#4

I don’t understand your last message, but I’ve created a simpler formula that works:

IF(Sale, DATETIME_DIFF( Sale, Purchase,'d'),DATETIME_DIFF( TODAY(),Purchase,'d')).

You can see my table: https://airtable.com/shrM7rGbN4msFSGPT

  • You don’t need to wrap the DATETIME_DIFF function
  • You don’t need a field for Today, as you have TODAY() function
  • You don’t need to make = ""with the Sale Date
  • Recommendation: field names with just one word, so you don’t need the {}:
    • Just Sale, as it’s a Date field
    • Join words as SaleDate
    • Separate words with an underscore: Sale_Date.

#5

Thank you for the help!