If Function with OR

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use an IF function to asign a code per region. I have two
codes one code for two countries and an other code for all others. In my if
statement how will i get it to look for the two, i need something that works
like an OR. So IF the cell has Place1 or Place2 give it a specific code ELSE
give it another code.

Please Help
 
Try something like this:

For
A1: (a country)

This formula assigns Place2 and Place3 to Region_1, all others are
Other_Region
B1: =IF(SUM(COUNTIF(A1,{"Place2","Place3"})),"Region_1","Other_Region")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
Hi Darren, what you want is something like this:

=IF(OR(A1,A2),first thing,secondthing)
 
syntax you need is

=if(or(condition1,condition2),DoTrue,DoFalse)

hope this helps
 
A bit shorter (and easier to follow)

A1: (a country)

B1: =IF(OR(A1="Place2",A1="Place3"),"Region_1","Other_Region")

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top