Indexing Mult. Unique Cells by Matching Cell of Table1 to Mult. Cells of Table2 - Create Dropdown

Copper Contributor

I have two tables. One is a list of primary keys I want to return data for. The other table is a list of duplicate primary keys with unique cells. I want to match primary keys and have a drop down of the unique values associated with the primary key.

 

My Primary Key is an USPS ZIP Code. Table One has a specific set of ZIP Codes I need to return data for. Table Two has a list of every ZIP Code and every corresponding City. Every ZIP Code has multiple Cities. (i.e. ZIP Code 63122 includes the USPS Primary City Name Saint Louis and an Acceptable Name Kirkwood).

 

In Table One, I want to match the ZIP Code 63122 to the ZIP Codes 63122 in Table Two and only return the cities listed as Primary and Acceptable. I want the cities listed in a drop down so that I can select the city I want. A step further, I want to be able to change the Primary Keys (ZIP Codes) in Table One and have the drop down automatically update.

 

I need to be able to type in a specific ZIP Code, see all associated Cities and select the appropriate City. I want to use this as a master file so that I can use it with multiple lists of ZIP Codes.

 

Is this possible? Is there a better way?

1 Reply

@Audit5 

 

Ctrl+Shift+Enter

=IFERROR(INDEX(Sheet1!$B$1:$B$20,SMALL(IF(Sheet1!$A$1:$A$20='2019 ZIP Codes and Cities'!$A$2,ROW(Sheet1!$A$1:$A$20)),ROW(A1)),1),"")

 

Pull vertically as far as needed. Error check included so you won't get #NUM errors when there's no  more cities to pull.

 

If you have FILTER function that's an option, too.