Search code examples
google-sheetsindexing

Index and return more than one outcome if duplicated


I am making a timetable system, I need to see which teacher teaches a specific class, and sometimes there are more than one.

I have tried =JOIN(", ", FILTER(OVERVIEW!$A:$A, IFERROR(SEARCH(A2, OVERVIEW!$B:$AX), FALSE))) and =FILTER(OVERVIEW!$A$1:$A$100, ARRAYFORMULA(REGEXMATCH(TRANSPOSE(OVERVIEW!$B$1:$AX$100), A2))) but none of this is working.

The teachers are in OVERVIEW!A:A and the classes are in OVERVIEW!B:BX along with an search sheet for this.

I have provided an example, and I am aware of the risks that come with sharing via google sheets sheet here


Solution

  • You may try:

    =join(", ",unique(tocol(arrayformula(if(search(A2,OVERVIEW!B:AX),OVERVIEW!A:A,)),3)))
    

    enter image description here