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

  • Chris Ho
    Chris Ho Employee
    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

  • Chris Ho
    Chris Ho Employee
    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.

  • That worked, thank you!!!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!