Nested IF with IF(OR statement not working

I am trying to set dates based on country - the US, CA, and UK are singular, whereas the EU, APAC, etc, have many countries (using OR).

=IFERROR(IF(OR(GEO@row = "US"), [Req. ETD Date]@row + 31, (IF(GEO@row = "CA"), [Req. ETD Date]@row + 55, (IF(GEO@row = "UK"), [Req. ETD Date]@row + 56, (IF(OR(GEO@row = "EU", GEO@row = "FR", GEO@row = "DE"), [Req. ETD Date]@row + 65, IF(OR(GEO@row = "CN", GEO@row = "TW", GEO@row = "ANZ", GEO@row = "PH", GEO@row = "SM", GEO@row = "JP", GEO@row = "TH", GEO@row = "KR"), [Req. ETD Date]@row + 14, [Req. ETD Date]@row + 30)))))), "")

Answers

  • Melissa Yamada
    Melissa Yamada ✭✭✭✭✭

    @Hello @JAAS

    It looked like you have an excess "(" on the second IF statement. Try removing it and see if it'll work.

    (IF(OR(GEO@row = "EU", GEO@row = "FR", GEO@row = "DE"), [Req. ETD Date]@row + 65,

    Melissa Yamada
    melissa@insightfulsheets.com
    Data made simple, spreadsheets reimagined

  • thank you - I removed it but no luck - invalid argument

    =IFERROR(IF(OR(GEO@row = "US"), [Req. ETD Date]@row + 31, IF(GEO@row = "CA"), [Req. ETD Date]@row + 55, IF(GEO@row = "UK"), [Req. ETD Date]@row + 56, IF(OR(GEO@row = "EU", GEO@row = "FR", GEO@row = "DE"), [Req. ETD Date]@row + 65, IF(OR(GEO@row = "CN", GEO@row = "TW", GEO@row = "ANZ", GEO@row = "PH", GEO@row = "SM", GEO@row = "JP", GEO@row = "TH", GEO@row = "KR"), [Req. ETD Date]@row + 14, [Req. ETD Date]@row + 30))), "")

  • Melissa Yamada
    Melissa Yamada ✭✭✭✭✭

    @JAAS

    What happened is your first IF statement should be an individual IF statement without the OR since they have individual logic when the statement is true and we'll need to adjust the number of closing parenthesis at the end to accommodate the OR function that we removed. (I hope this makes sense)

    Here's the updated formula:

    =IFERROR(IF(GEO@row = "US", [Req. ETD Date]@row + 31, IF(GEO@row = "CA", [Req. ETD Date]@row + 55, IF(GEO@row = "UK", [Req. ETD Date]@row + 56, IF(OR(GEO@row = "EU", GEO@row = "FR", GEO@row = "DE"), [Req. ETD Date]@row + 65, IF(OR(GEO@row = "CN", GEO@row = "TW", GEO@row = "ANZ", GEO@row = "PH", GEO@row = "SM", GEO@row = "JP", GEO@row = "TH", GEO@row = "KR"), [Req. ETD Date]@row + 14, [Req. ETD Date]@row + 30))))), "")

    Melissa Yamada
    melissa@insightfulsheets.com
    Data made simple, spreadsheets reimagined

  • Thanks again; I tried that; however, it did not work because of the added ( I missed - appreciate the assistance.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!