Skip to main content
Solved

Automation that adds or subtracts days from a date based on single select


not_my_job
Forum|alt.badge.img+2

I’m an airtable newbie. I’m building a base for planning production (live events) for the AV company I work for. One of the things I need to track is our pre show, show, and post show milestones in the planning process. The time frame is based on when we are loading in gear for the event. I need to make an automation that will take the load-in date and subtract 30 days for pre-show items, stay the same date for show items, and add 14 days for post show items. I have the pre, show, and post as a single select. Any and all help would be appreciated 

Best answer by kuovonne

You can use a formula field to calculate the date. If having the date field in a calculated field is good enough, you do not need an automation. If you need to move the date into an editable field, then couple the formula field with an automation that updates the editable field with the formula result.

 

Because you want to add a different number of days depending on the value of the single select field, I suggest a SWITCH() formula.

DATEADD(
  {Load-in Date},
  SWITCH( {milestone},
    "pre-show", -30,
    "show", 0,
    "post show", 14
  ),
  "days"
) 

 

View original
Did this topic help you find an answer to your question?

3 replies

Mike_AutomaticN
Forum|alt.badge.img+21

Hey ​@not_my_job!

If I’m getting the use case right, then you will want to have a formula where you will be having a combination of IF() and Dateadd() formulas.

smth like..

IF({single select field}=”preshow”, dateadd(…, “days”), dateadd(…, “days”)) 


For sure the above is just an example, but if you share with me exact field names I can get the exact formula for you.

Regardless of the above, please do feel free to scheule a call if you’d like us to go through this together. I’d be happy to help out.

Mike, Consultant @ Automatic Nation


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6001 replies
  • Answer
  • March 25, 2025

You can use a formula field to calculate the date. If having the date field in a calculated field is good enough, you do not need an automation. If you need to move the date into an editable field, then couple the formula field with an automation that updates the editable field with the formula result.

 

Because you want to add a different number of days depending on the value of the single select field, I suggest a SWITCH() formula.

DATEADD(
  {Load-in Date},
  SWITCH( {milestone},
    "pre-show", -30,
    "show", 0,
    "post show", 14
  ),
  "days"
) 

 


not_my_job
Forum|alt.badge.img+2
  • Author
  • New Participant
  • 1 reply
  • March 25, 2025

Thank you both so much! The formula worked! 


Reply