Hi Isaac,
nice logic problem to think. I recommend to use the AND and nested if checks.
However I have to mention that having a function in a field by default the field is not blank even if it seems blank. So to deal with that you can check the length of the field if it is above 1 means there is a date completed in the field, otherwise there are no values.
So you can use the following:
IF (AND(len(date_modified)<1, shipping method = “boat”),dateadd(TODAY(),52,‘days’),IF(AND(len(date_modified<1), shipping method = “flight”),dateadd(TODAY(),21,‘days’),IF(AND(len(date_modified>1), shipping method= “boat”),dateadd(date_modified,52,‘days’),dateadd(date_modified,21,‘days’))))
Please when you put the function on run be sure for the parenthesis. In case you face any trouble please do not hesitate to post it here
Hi can you copy and paste here the function please? You have missed some parenthesis.
I will copy it and correct it for you :winking_face:
The errors were caused (At least in part) due to using curly quotes within the formula and not straight quotes. In the forums, its best practice to wrap formulas in single ` or triple ```, which will force straight quotes.
In general, the formula can be simplified down quite a bit:
DATEADD(
IF({Date of Payment}, {Date of Payment}, TODAY()),
SWITCH({Shipping}, "boat", 52, "flight", 21),
"days"
)
The errors were caused (At least in part) due to using curly quotes within the formula and not straight quotes. In the forums, its best practice to wrap formulas in single ` or triple ```, which will force straight quotes.
In general, the formula can be simplified down quite a bit:
DATEADD(
IF({Date of Payment}, {Date of Payment}, TODAY()),
SWITCH({Shipping}, "boat", 52, "flight", 21),
"days"
)
Hi @Kamille_Parks ,
This is really more efficient, I hade never used the switch function and your recommendation is really more efficient!
Thanks