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))), "")
-
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
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.4K Get Help
- 424 Global Discussions
- 221 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 61 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!