You are here:

# Excel/extracting names from a list

Advertisement

Question
QUESTION: Hi Tom

Could you possibly help me with this issue?  I have five ranges.  Some students will appear in all of the ranges.  I need to make a list of students who appear in all of the lists.  So if “Olding, Freddie” studies all five subjects I would like him to appear in the list.  The ranges are as follows:

“A1000:AF2999”
“A3000:AF4999”
“A5000:AF5999”
“A7000:AF7999”
“A9000:AF9999”

Can this be achieved with a formula?

Thanks in advance.

Chris Mitchell

ANSWER: Christopher,

You would need a list to work with.   You could then mark which members of the list statisfy the condition by using countif

say Olding, Freddie is in A1000 and all the names are in column A for the topmost list
in B1000 or some other column in B
=if(And(countif(countif(A3000:AF4999,A1000)>0,countif(A5000:AF5999,A1000)>0,countif(A7000:AF7999,A1000)>0,countif(A9000:AF9999,A1000)>0),"Yes","No")

then drag fill down to row 2999

so you are only checking against the list in A1:A2999 since they must be in that list to be in all five lists and identifying which of those in list one are also in the other 4 lists.  You could then write a formula to pull those names into a separate list using this result column if you wished.

--
Regards,
Tom Ogilvy

[an error occurred while processing this directive]---------- FOLLOW-UP ----------

QUESTION: Hi Tom

When I enter your formula I get this error message:  "There are too many
many arguments for this function"

Have you any idea what the problem might be?

Chris Mitchell

Answer
Christopher,

that is because when I originally wrote it, I put in all five ranges.  But I was going to say you needed a list of names to work against.  Then I came to the conclusion that you could work against one of the lists and didn't need to check that list because of the reason I stated in my answer.  So I edited out the first range, but in editing I left the countif so as you can see it goes

countif(countif   which is a typo.  this should work and sorry for the inattention but editing long involved formulas in this environment can be challenging.

=IF(AND(COUNTIF(A3000:AF4999,A1000)>0,COUNTIF(A5000:AF5999,A1000)>0,COUNTIF(A7000:AF7999,A1000)>0,COUNTIF(A9000:AF9999,A1000)>0),"Yes","No")

That was tested (lightly) and worked for me.

--
Regards,
Tom Ogilvy

Questioner's Rating
 Rating(1-10) Knowledgeability = 10 Clarity of Response = 10 Politeness = 10 Comment Hi Tom Thanks for prompt response. Chris Mitchell

• Add to this Answer
• Ask a Question
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Tom Ogilvy

##### Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

##### Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 About.com. All rights reserved.

Browse Answers:

[an error occurred while processing this directive]