Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

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

  • ✭✭✭✭✭

    @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))), "")

  • ✭✭✭✭✭

    @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.

  • ✭✭

    thank you this was indeed the issue an extra ( - if you stare at something too long g it always look correct. Nice to have additional eyes on occasion.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions

  • I'm trying to create a SUMIF formula that looks at the salesperson name in a column and adds up or totals their $ sales in another column. To ultimately show in Dashboard of Totals Sales by Salesperso…
    User: "Allan Z"
    Answered ✓
    9
    2
  • Good day Smartsheet Team, Getting an unparseable error on this formula: =IF($Name@row <> "",(SUMIFS({Expense}, {Period},1, {Type}, OR(@cell = "RES602782", @cell = "RES602497")),"") Trying to pull in a…
    User: "stratman"
    Answered ✓
    15
    2
  • I have a sheet that compiles all the responses from a form. The sheet has multiple start and end date columns, but only one start and one end date cell is NOT blank depending on the activity selected …
    User: "m_anderson"
    Answered ✓
    13
    2