Help

Formula for 90 days after, up to a certain date.

Topic Labels: Formulas
577 1
cancel
Showing results for 
Search instead for 
Did you mean: 
sarahunite2030
4 - Data Explorer
4 - Data Explorer

Hey! 

I'm trying to figure out how to add a portion to a formula that would ensure that it's set for 90 days after a particular field, or before June 1st. The current formula pulls from a date field for when they registered (Date Registered), and adds 90 days. How would I add a restriction onto this formula so it's 90 days, or until June 1st? 

 

DATETIME_FORMAT(DATEADD({Date Registered}, 90, 'days'), 'MM/DD/YYYY')
1 Reply 1

Try this:

Screenshot 2024-03-19 at 10.48.08 AM.png

IF(
  IS_AFTER(
    DATEADD({Date Registered}, 90, 'days'),
    DATETIME_PARSE(
      '01062024',
      'DDMMYYYY'
    )
  ),
  DATETIME_PARSE(
    '01062024',
    'DDMMYYYY'
  ),
  DATEADD({Date Registered}, 90, 'days')
)

 Do note that the year for 1st June is hardcoded though.  We could make it take the current year into account, but that would mean that the previous year's records would be all weird you know what I mean?