How to auto populate a list of names from sheet1 to sheet2 based on class

I have a workbook where I input a list of names and other data such as class that the person is in on the Attendee List worksheet. On the Attendee Worksheets worksheet I want to be able to auto populate it with a list of names from the Attendee List worksheet where the class = Nursery for example. On the Attendee Worksheets tab I created a dropdown list and named it ClassLookupN and tried to do a vlookup but can't seem to get it.

Please Help.

Mark WoodNetwork AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Try this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.

On Attendance Worksheets
In A3
=IFERROR(INDEX(Name,SMALL(IF(AttendeeClass=ClassLookupN,ROW(Name)-ROW('Attendee List'!$B$9)+1),ROWS(A$3:A3))),"")

Open in new window

And copy down. I have copied the formula down to row100 in the attached workbook. So if you add more Names and Classes on Attendee List, the correct Names will be automatically reflected on Attendance Worksheets.

As you can see that to make the formula work, I have created another Named Range "Name".

For details refer to the attached workbook.

Remember that an Array Formula is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.  You will know the array is active when you see curly braces { } appear around your formula.  If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.  Press F2 on that cell and try again.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark WoodNetwork AdministratorAuthor Commented:
That is absolutely perfect .. Thank you. Now all I have to do is figure out how to be able to lookup perfect attendance and create a certificate.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome. Glad I could help. :)
And all the best for rest of the work. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.