I am trying to create a spreadsheet that looks up data from two other worksheets. Those two spreadsheets have an odbc session to an oracle database. The first runs a sql which shows vendors. The second shows vendor names and their locations. Each vendor can have multiple locations in the second worksheet.

I have set up data validation on the input sheet which pulls the vendor names. I would like to have the next column then just show the relevant locations for that vendor. I have read about the indirect function, but that doesn't seem to work for my needs. It appears that to use that, the vendors need to be across in a row with the associated locations below. Since I am using a sql, i get one row per location.

Any help would be greatly appreciated! Thanks.