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.
-
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
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.5K Get Help
- 448 Global Discussions
- 145 Industry Talk
- 481 Announcements
- 5.1K Ideas & Feature Requests
- 85 Brandfolder
- 152 Just for fun
- 73 Community Job Board
- 492 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 304 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!