I have a table of data in Excel that has a company ID
in one column and a NAICS code
in another column. Only one NAICS code can be entered per row. Within the table a company ID can appear more than once with the same or a different NAICS code.
In a separate table (tab) I have a list of unique company IDs with a separate column called NAICS codes
. I want to create a formula that lists all NAICS codes belonging to a company in a string in that field.
Table 1
Company ID NAICS Code
1 334
1 334
2 311
2 3231
2 311
3 311
3 311
3 336390
4 331110
5 311821
6 311821
4 336411
3 3115
Table 2
Company ID NAICS Codes
1 334
2 311, 3231
3 311, 336390
4 331110, 31110, 336411
5 311821
6 311821