Help

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

Topic Labels: Formulas
1270 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Angie_Belle
6 - Interface Innovator
6 - Interface Innovator

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

4 Replies 4

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

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.

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.

Thank you for the help!