1

I've got Table A like so:

Names     Age 
-----------------
John      3
Jane      4
Mary      5 
John      6
Chris     7
Mary      8
Michael   9

and Table B like so

Cool Names
--------
Mary
Michael

I want to create a filter on Table A such that it only shows me names that appear in Table B. Which means I should have a resulting view that looks like:

Names     Age 
-----------------
Mary      5 
Mary      8
Michael   9

The formula needs to go enter image description here

into that box. Here's a sample sheet. Thanks in advance.

1
  • 1
    I'll accept anything that creates my filter. I've tried putting in =FILTER(A2:A, COUNTIF('Cool Names'!A:A, A2:A)>0) into the field, but it doesn't work. That forumla works if I put it into a normal cell, so it feels like that field is looking for something more specific. Not sure what it is. Commented Nov 2, 2017 at 22:19

1 Answer 1

2

Assuming Names are in ColumnA and Table B is in ColumnG then a custom formula of:

=countif(G:G,A2)

should work.

My preference however would be for the FILTER function:

=FILTER(A2:A,COUNTIF(TableB,A2:A)) 

where TableB is a named range (in the same document, but not necessarily the same sheet).

(And I'd not bother to cater for headers, =FILTER(A:A,COUNTIF(TableB,A:A)) should be adequate.)

Sign up to request clarification or add additional context in comments.

1 Comment

This works, but what if Table B is in another sheet?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.