Using VLOOKUP with more than two items in a cell

A

art

I am building a workbook in Excel 2007 that has two sheets---one called Course
and the other called Textbooks. The first sheets lists all of the courses in ou
department, and the second sheet lists all of the textbooks assigned to thos
courses.

In the Textbooks sheet, I have one row for each textbook title. One cell i
each row includes the course ID(s) of the courses that use that textbook. Th
user enters the course ID (cell AA), then the cell to the right (AB
autopopulates with the course title(s) from the first sheet (Courses).

VLOOKUP works easily if there was only one course ID in the cell. The challeng
is how to handle when more than one course uses the textbook, so AA migh
contain BUS 110, BUS 294, MGT 240, rather than just BUS 294.

A friend helped me write a formula if there were TWO course IDs:

=VLOOKUP(LEFT(AA37,FIND(",",AA37)-1),Courses!A:B,2,0)&",
&VLOOKUP(TRIM(MID(AA37,FIND(",",AA37)+1,255)),Courses!A:B,2,0)

It works fine. However, it doesn't work if there are more than two course IDs.

Any thoughts on how to revise the formula to work if there is one, two, or mor
than two course IDs?

Thanks!!!
 

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