# Estimated Delivery Date from todays date or date Payment is Received (nested if formula)

Topic Labels: Formulas
Solved
1449 4
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

4 columns to do this
Shipping Method - single select: boat, shipping
Estimated Delivery Date - formula. I want to write an if statement.

This is what I have so far but I’m not sure how to write the second if statement

I would like to know how to write is so that is when payment is received estimate delivery is from payment date

if date modified is blank then from today boat +52days if flight +21days
if date modified is not blank then from date modified boat +52days if flight +21days

1 Solution

Accepted Solutions
16 - Uranus

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:

IF({Date of Payment}, {Date of Payment}, TODAY()),
SWITCH({Shipping}, "boat", 52, "flight", 21),
"days"
)
4 Replies 4
9 - Sun

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:

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 :slightly_smiling_face:

9 - Sun

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:

16 - Uranus

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: