Stringing IF/OR statements in a single formula
I am trying to string multiple IF/OR statements together. To summarize, if the column Location contains London, Brussels or Moscow, the resulting value should be Europe. If the Location column contains Dubai or Riyadh, the value should be Middle East. If the Location column contains any other value, the result should be the existing value from the Location field.
This formula works.
=IF(OR(Location@row = "London", Location@row = "Brussels", Location@row = "Moscow"), "Europe", Location@row)
However, I need to include the following to the above formula:
=IF(OR(Location@row = "Dubai", Location@row = "Riyadh"), "Middle East", Location@row)
I have tried so many variations and can't seem to get this to work. If anyone has a suggestion, I would be greatly appreciative.
Best Answer
-
Hi Cheryl,
You're super close on this one. You can just put your second formula inside the "value if false" section of the first formula like so:
=IF(OR(Location@row = "London", Location@row = "Brussels", Location@row = "Moscow"), "Europe", IF(OR(Location@row = "Dubai", Location@row = "Riyadh"), "Middle East", Location@row))
This basically tells the formula that if the value is not London, Brussels, or Moscow, evaluate what is in the "value if false" section.
Answers
-
Hi Cheryl,
You're super close on this one. You can just put your second formula inside the "value if false" section of the first formula like so:
=IF(OR(Location@row = "London", Location@row = "Brussels", Location@row = "Moscow"), "Europe", IF(OR(Location@row = "Dubai", Location@row = "Riyadh"), "Middle East", Location@row))
This basically tells the formula that if the value is not London, Brussels, or Moscow, evaluate what is in the "value if false" section.
-
That worked, thank you!!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.1K Get Help
- 450 Global Discussions
- 155 Industry Talk
- 505 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 80 Community Job Board
- 514 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!