I have a spreadsheet 'Database' where there are two columns, 'Countries' (A) and 'Companies'(B). Countries are numbered from 1-10. Companies are labelled with letters.
The spreadsheet tracks the companies that operate in each country. As such, a row that has Country 1 in column A and Company A in column B means that Company A operates in country 1. This is a screenshot from this spreadsheet:
I then have a second spreadsheet called 'Countries by Company' where I would like to list the countries in which a company operates. I would like them to be listed in different rows starting form cell B3 of the 'Countries by Company' sheet. The company name for which the countries should be listed is in cell B1 of the same sheet. I gather this has to be done with an ARRAY
version of an INDEX MATCH
function but I can't seem to get it to work.
I have put the following formula in cell B3 of the 'Countries by Company' sheet: =INDEX(Database!$A$1:$B$76, MATCH($B$1, Database!$B$1:$B$76, 0), COLUMN(Database!A:A))
. However, as expected, it will only return the first country in which the company in cell B1 operates and no other country. Again, I would need all countries in which that company operates listed in different rows from cell B3.
I have set up a sample sheet in here. I thought it might help in case I wasn't too clear.
Thanks for your help!