Oct 31, 2022 03:21 AM
I’m trying to set up a formula to determine the start up date of a project depending on whether it is a Tier 1 or Tier 2 event. Tier 1 will have a 4 month lead time. Tier 2 event will have a 3 month lead time.
IF ({Tier} = 1, DATEADD({Event start}, -4, ‘month’)
IF ({Tier} = 2, DATEADD({Event start}, -3, ‘month’)
This formula is ‘invalid’ - please help!
Oct 31, 2022 05:21 AM
Welcome to the Airtable community!
You need a different nesting to you formula.
IF(
{Tier} = 1,
DATEADD({Event start}, -4, 'month'),
IF(
{Tier} = 2,
DATEADD({Event start}, -3, 'month')
))
There are many ways to do things in code. Here is another option.
DATEADD(
{Event start},
SWITCH( {Tier},
1, -4,
2, -3
),
'month'
)
Oct 31, 2022 07:00 AM
Thanks so much, the second formula worked!