IF - OR statement with 2+ conditions

BurkeDad

New Member
Joined
Jul 8, 2011
Messages
24
I am trying to create an if-or statement with 2+ conditions. Here is what I have thus far. Where am I going wrong.

=if((B2="USGS",1),or(B2="CONT",2),or(B2="VOL",1),0)
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I am trying to create an if-or statement with 2+ conditions. Here is what I have thus far. Where am I going wrong.

=if((B2="USGS",1),or(B2="CONT",2),or(B2="VOL",1),0)

What is the result you are looking to return?

Try laying your formula out like this:

=IF(OR(condition1,condition2,etc),value if true,value if false)

So for example if B2 is either USGS or CONT then show 1 otherwise show 2 then your formula would read:

=IF(OR(B2="USGS",B2="CONT"),1,2)

Hope this helps!

:)
 
Upvote 0
I am trying to create an if-or statement with 2+ conditions. Here is what I have thus far. Where am I going wrong.

=if((B2="USGS",1),or(B2="CONT",2),or(B2="VOL",1),0)

Try this:

Code:
=IF(OR(B2="USGS",B2="VOL"),1,IF(B2="CONT",2,0))
 
Upvote 0
Thanks for the help all. They all worked great - used the last one because I actually needed 3 conditions.

Thanks again for the help!
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top