Jump to content

Another Excel query

Recommended Posts

I have a spreadsheet in which Column A has a list of membership numbers for people in a club:

 

1

2

3

4

5

6

Etc

 

In column C is a list of membership numbers of a subgroup of these people:

 

1

4

5

 

In Column B I want to have 'Yes' inserted for each row - so it will appear as:

 

1 Yes

2

3

4 Yes

5 Yes

6

 

Any ideas how I can do this? It might be to do with Excel's vlookup function but this isn't something I've used or understand.

 

Any help appreciated!

Share this post


Link to post
Share on other sites

So in column B it will say yes if the value in column A is contained in column C anywhere?

 

=COUNTIF(range,value)>0

 

For example

 

=COUNTIF($C$1:$C$3;A1)

 

Where $C$1:$C:$3 is your subset and A1 is the cell to the left (so this statement is written in B1).

 

This will give you the value 1.

 

If 1 must say yes then this will need wrapping in an if

 

=if(B1>0,"Yes","No")

 

combine the two

 

=if(COUNTIF($C$1:$C$3;A1)>0,"Yes","No")

Edited by Cyclone

Share this post


Link to post
Share on other sites
So in column B it will say yes if the value in column A is contained in column C anywhere?

 

Yes, that's it.

 

PS Looks like we're neighbours!

Share this post


Link to post
Share on other sites

This would do you:

 

=IF(MATCH(A1,C:C,0),"Yes","No")

 

It does give nasty #N/A errors on rows with no match so cyclones answer is probably better!

Share this post


Link to post
Share on other sites

Brilliant - thanks very much!

 

So in column B it will say yes if the value in column A is contained in column C anywhere?

 

=COUNTIF(range,value)>0

 

For example

 

=COUNTIF($C$1:$C$3;A1)

 

Where $C$1:$C:$3 is your subset and A1 is the cell to the left (so this statement is written in B1).

 

This will give you the value 1.

 

If 1 must say yes then this will need wrapping in an if

 

=if(B1>0,"Yes","No")

 

combine the two

 

=if(COUNTIF($C$1:$C$3;A1)>0,"Yes","No")

 

---------- Post added 30-03-2017 at 15:54 ----------

 

This would do you:

 

=IF(MATCH(A1,C:C,0),"Yes","No")

 

It does give nasty #N/A errors on rows with no match so cyclones answer is probably better!

 

I actually used Cyclone's solution but thanks to you also for taking the trouble to help.

Edited by Grahamfff

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.