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
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 497 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!