# Using OR in if statements

**URL:** <https://community.blaze.today/t/using-or-in-if-statements/11010>\
**Category:** Questions and Help\
**Created:** [September 2, 2021, 2:50pm UTC](https://community.blaze.today/t/using-or-in-if-statements/11010 "2021-09-02T14:50:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santa\_Laren](https://community.blaze.today/user_avatar/community.blaze.today/santa_laren/32/9420_2.png) [@Santa\_Laren](https://community.blaze.today/u/Santa_Laren)\
**Post date:** [September 2, 2021, 2:50pm UTC](https://community.blaze.today/t/using-or-in-if-statements/11010/1 "2021-09-02T14:50:03Z")

</div>

Can I use OR in an if statement? for example {if: a == "Yes" OR b == "Yes" and c == "No"} then say this.

---

<div class="post-metadata">

**Author:** ![Diego\_Suancha](https://community.blaze.today/user_avatar/community.blaze.today/diego_suancha/32/3129_2.png) [@Diego\_Suancha](https://community.blaze.today/u/Diego_Suancha)\
**Post date:** [September 2, 2021, 3:54pm UTC](https://community.blaze.today/t/using-or-in-if-statements/11010/2 "2021-09-02T15:54:40Z")

</div>

Hey there @Santa_Laren Hope you are having a great day.

To answer your question, yes, you can include an OR statement in your snippets. Here is an example of how it looks in Text Blaze.

Select an option{formmenu: default=1; 2; 3; 4;5; name=Options; multiple=no}

{if: options==1 OR options==2}You selected 1 or 2{elseif: options==3 OR options==4}You selected 3 or 4{else}You selected 5{endif}

Example with AND it shows if your store is closed when you select the option 1

Is your store closed? {formtoggle: name=Closed; default=yes}

{if: closed == yes AND options==1}Your store is closed and you selected 1{elseif: closed==no AND options==1}Your store is open and you selected 1{else}You selected something else{endif}

Hope this helps 🤗 I am happy to help if anything else.

---

<div class="post-metadata">

**Author:** ![Santa\_Laren](https://community.blaze.today/user_avatar/community.blaze.today/santa_laren/32/9420_2.png) [@Santa\_Laren](https://community.blaze.today/u/Santa_Laren)\
**Post date:** [September 2, 2021, 3:57pm UTC](https://community.blaze.today/t/using-or-in-if-statements/11010/3 "2021-09-02T15:57:48Z")

</div>

Thank you for your reply Diego. That helps.

---

<div class="post-metadata">

**Author:** ![Cedric\_Debono\_Blaze](https://community.blaze.today/user_avatar/community.blaze.today/cedric_debono_blaze/32/1672_2.png) [@Cedric\_Debono\_Blaze](https://community.blaze.today/u/Cedric_Debono_Blaze)\
**Post date:** [September 3, 2021, 8:53am UTC](https://community.blaze.today/t/using-or-in-if-statements/11010/4 "2021-09-03T08:53:31Z")

</div>

Thanks @Diego_Suancha for the great example.

@Santa_Laren - here's another option you might want to explore:

option1: {formmenu: name=option1; yes; no}  
option2: {formmenu: name=option2; yes; no}  
option3: {formmenu: name=option3; yes; no}

{if: (option1=="yes" or option2=="yes") and option3=="yes"}Option 1 or 2 is "yes" AND option 3 is also "yes"{elseif: option3=="no"}Option 3 is "no". We don't care what options 1 and 2 are.{else}This is what shows up if none of the other conditions are met.{endif}

---

<div class="post-metadata">

**Author:** ![Santa\_Laren](https://community.blaze.today/user_avatar/community.blaze.today/santa_laren/32/9420_2.png) [@Santa\_Laren](https://community.blaze.today/u/Santa_Laren)\
**Post date:** [September 3, 2021, 10:00am UTC](https://community.blaze.today/t/using-or-in-if-statements/11010/5 "2021-09-03T10:00:52Z")

</div>

Very helpful, thank you Cedric!

---

<div class="post-metadata">

**Author:** ![Cedric\_Debono\_Blaze](https://community.blaze.today/user_avatar/community.blaze.today/cedric_debono_blaze/32/1672_2.png) [@Cedric\_Debono\_Blaze](https://community.blaze.today/u/Cedric_Debono_Blaze)\
**Post date:** [September 3, 2021, 10:16am UTC](https://community.blaze.today/t/using-or-in-if-statements/11010/6 "2021-09-03T10:16:35Z")

</div>

You're most welcome @Santa_Laren,

If you're interested, I have a special thread where members can throw any snippet at me and I try to find ways to improve it.

It's a lot of fun, and hopefully you get to walk away with a snippet that saves you even more time 🙂

Here it is:

> [@Can you break me?](https://community.blaze.today/t/can-you-break-me/10851/5):
>
> @Brad_Hedinger - awesome! Can you give me a few more details please? What do the acronyms stand for? Where are you getting the data and are you currently inputting it manually? And can you describe the desired workflow as a step-by-step process? I want to make sure I give you the desired outcome.
