Search code examples
google-sheetsindexing

Index return duplicates


I am making a timetable system and I am currently on student timetables.

I want to see when a student has a clash at the same period. Here is the example sheet

I am aware of the risks that come with sharing google sheets online.

Currently i have this code to find classes from an overview sheet =IFERROR(INDEX(OVERVIEW!A$3:A,MATCH(TRUE, REGEXMATCH(OVERVIEW!A$3:A, TEXTJOIN("|",1,$E$3:$E)),0),1),"FREE")

However, the above only returns one topmost outcome, and does now allow me to see if there are clashes.

Please advice <3


Solution

  • Slightly adjusting the formula you shared:

    Class:

    =join("; ",filter(regexextract(OVERVIEW!A3:A,"(.*?) "),regexmatch(OVERVIEW!A$3:A,textjoin("|",1,E3:E))))
    

    Subject:

    =join("; ",filter(regexextract(OVERVIEW!A3:A,"\((.*) \("),regexmatch(OVERVIEW!A$3:A,textjoin("|",1,E3:E))))
    

    Teacher:

    =join("; ",filter(regexextract(OVERVIEW!A3:A,"\(([^\(]*)$"),regexmatch(OVERVIEW!A$3:A,textjoin("|",1,E3:E))))
    

    enter image description here