Help with IF statement

X

XFILES

Here's what I have and what I'm trying to do. I have a different country
names in cells A1 through A6. For example, A1 says Russia, A2 says US, A3
says UK, and so on.

In cell G1, G2, G3 I have more countries which are part of the group I have
called EM. G1 has Russia, G2 has Mexico, and G3 has Brazil in it. Again,
these three cells are in a group called EM.

What I want to do is write a function in cell B1 that will look at what
country is in A1 and if the country in A1 matches a country in the group EM
it will say "Yes". If it does not match a country in the group EM it will
say "No". Then I would just copy the formula down from B1. Any ideas. I
believe it will be an IF statement and maybe an OR statement, but I'm not
sure how to write it. Any help is appreciated. Thanks.
 
J

JE McGimpsey

If by "a group" you mean a named range, then

B1: =IF(COUNTIF(em, A1),"Yes","No")

Or you could use the ranges directly:

B1: =IF(COUNTIF(G1:G3,A1),"Yes","No")

If that doesn't work, please explain what you mean by "group"
 
X

XFILES

Thank you very much. Both solutions in this post and the previous post
worked. Thank you for all the help. I appreciate it so much.
 

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

Top