Avatar of Anthony Pangilinan
Anthony Pangilinan
Flag for United States of America asked on

Can I populate a Google Sheet column using a query that finds all the matches from another sheet?

Sheet1Sheet2
I have two Google Sheets. Sheet1 is categorizing the "Places" from Sheet2. I want to populate the "Categories" column on Sheet2 with all the headers from Sheet1 whose columns contain the given "Place". For example, the "Categories" cell for "Alabama" should contain "Bands, States" (or whatever concatenation format can be done).
Google* google spreadsheetsSpreadsheetsMicrosoft Excel

Avatar of undefined
Last Comment
Anthony Pangilinan

8/22/2022 - Mon
Professor J

this is the formula to put in Sheet2 B2

=TextJoin(",",True,FILTER(Sheet1!$A$1:$C$1,INDEX(Sheet1!$A$2:$C$20,MATCH(A2,Sheet1!$A$2:$A$20))=A2))
Anthony Pangilinan

ASKER
Thanks for the reply! That seems to be working properly for cases when the "Place" occurs on the same line in multiple columns, but not when it is on different lines between columns. "Alabama" looks like the only case it's completely working on.
function1.PNG
Professor J

Can you please share the dummy file link here, so that I build the formula there?
Your help has saved me hundreds of hours of internet surfing.
fblack61
Anthony Pangilinan

ASKER
ASKER CERTIFIED SOLUTION
Anthony Pangilinan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.