IF({Type of Task}="CANCEL",DATEADD({Check In Date},-1,'days'),IF({Type of Task}="REBOOK",DATEADD({Check In Date},-60,'days'),IF({Type of Task}="CHECK PAYMENT",DATEADD({Check In Date},1,'days'))))
Every ( must have a closing ). You cannot have extra ) or extra ( or your formula won’t work. Your revised formula doesn’t work because you closed off the first set of ( and then added more closing ) to the very end; in other words, you aren’t nesting IF() statements properly
Instead of nesting several IFs together to check the value of the same field, use a single SWITCH statement to reduce the number of parenthesis to track:
SWITCH(
{Type of Task},
"CANCEL",DATEADD({Check In Date},-1,"days"),
"REBOOK",DATEADD({Check In Date},-60,"days"),
"CHECK PAYMENT",DATEADD({Check In Date},1,"days")
)
^ Even that can be re-worked since its a DATEADD to the same field every time.
IF(
AND({Type of Task}, {Check In Date}),
DATEADD(
{Check In Date},
SWITCH(
{Type of Task},
"CANCEL",-1,
"REBOOK",-60,
"CHECK PAYMENT",1
),
"days"
)
)
Thank you so much for taking the time to explain, I am new to this and struggling with the formulas. Will give it a try!
Every ( must have a closing ). You cannot have extra ) or extra ( or your formula won’t work. Your revised formula doesn’t work because you closed off the first set of ( and then added more closing ) to the very end; in other words, you aren’t nesting IF() statements properly
Instead of nesting several IFs together to check the value of the same field, use a single SWITCH statement to reduce the number of parenthesis to track:
SWITCH(
{Type of Task},
"CANCEL",DATEADD({Check In Date},-1,"days"),
"REBOOK",DATEADD({Check In Date},-60,"days"),
"CHECK PAYMENT",DATEADD({Check In Date},1,"days")
)
^ Even that can be re-worked since its a DATEADD to the same field every time.
IF(
AND({Type of Task}, {Check In Date}),
DATEADD(
{Check In Date},
SWITCH(
{Type of Task},
"CANCEL",-1,
"REBOOK",-60,
"CHECK PAYMENT",1
),
"days"
)
)
Thanks again both work, I have learned something new!