Help

Date formula help!

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

Hi! I'm trying to set up a formula for a "Production Slack Reminder" that would be based on the "Send Date."

 

If the "Send Date" falls on a Tuesday, Wednesday, Thursday, or Friday, the "Production Slack Reminder" should happen the day before the "Send Date"

If the "Send Date" falls on a Monday, Saturday, or Sunday, the "Production Slack Reminder" should happen the Friday before that weekend

1 Reply 1

Try this:

SWITCH(
  DATETIME_FORMAT(
    {Send Date},
    'ddd'
  ),
  'Sat', DATEADD({Send Date}, -1, 'days'),
  'Sun', DATEADD({Send Date}, -2, 'days'),
  'Mon', DATEADD({Send Date}, -3, 'days'),
  'Tue', DATEADD({Send Date}, -1, 'days'),
  'Wed', DATEADD({Send Date}, -1, 'days'),
  'Thu', DATEADD({Send Date}, -1, 'days'),
  'Fri', DATEADD({Send Date}, -1, 'days')
)

Screenshot 2024-02-28 at 10.33.40 AM.png