Skip to main content
Solved

I need help with a formula to change the status based on number of days before expiration

  • January 26, 2022
  • 2 replies
  • 41 views

I am trying to create a formula that will change a column to say Active or Inactive based on the numbers of days before an item expires.

For example: I have contracts that expire over the next four years. When one of the contracts gets within 6 months of expiring I need a column to change to Active or Inactive. All of the Actives will be within 6 months of expiring Inactives will be anything valid for more then 6 months.

I tried to use this formula I found in the forums and changed my expiration date column to Purchase Date just so the columns would match and it keeps telling me that it is an invalid formula.

IF(DATETIME_DIFF(TODAY(), {Purchase Date}, ‘days’) < 365, ‘Inactive’, ‘Active’).

Thanks for any help you can provide.

Best answer by AirtableBuilds_

Hi Lisa,

It might be a quick fix by correcting the in your formula to a .

Try copying the corrected formula below and see if that works. If not I would say that the field {Purchase Date} might not be a date field

IF(DATETIME_DIFF(TODAY(), {Purchase Date}, 'days') < 365, 'Inactive', 'Active')

Let me know how you go :slightly_smiling_face:

Una

2 replies

  • Participating Frequently
  • 7 replies
  • Answer
  • January 27, 2022

Hi Lisa,

It might be a quick fix by correcting the in your formula to a .

Try copying the corrected formula below and see if that works. If not I would say that the field {Purchase Date} might not be a date field

IF(DATETIME_DIFF(TODAY(), {Purchase Date}, 'days') < 365, 'Inactive', 'Active')

Let me know how you go :slightly_smiling_face:

Una


  • Author
  • New Participant
  • 1 reply
  • January 31, 2022

Hi Lisa,

It might be a quick fix by correcting the in your formula to a .

Try copying the corrected formula below and see if that works. If not I would say that the field {Purchase Date} might not be a date field

IF(DATETIME_DIFF(TODAY(), {Purchase Date}, 'days') < 365, 'Inactive', 'Active')

Let me know how you go :slightly_smiling_face:

Una


This worked perfect. Thank You!!!