Search code examples
google-sheetsgoogle-apps-scriptgoogle-sheets-formula

Schedule View: INDEX MATCH from table and return multiple cells into one


Please find the reference Google Sheet here. (View only access, please File > Make A Copy)

I am trying to take a data table for a work conference schedule of sessions ("Session Details" sheet) and have it automatically populate a vertical agenda format ("Master Agenda" sheet).

On the "End Goal" sheet, you can see what I am ultimately trying to accomplish.

I have currently set up the following formula in C16 to pull data from the "Session Details" sheet to populate the Session Name into the "Master Agenda" sheet:

=IFNA(INDEX('Session Details'!$E:$E,MATCH(1,('Session Details'!$A:$A=$C$2)*('Session Details'!$B:$B=$A16)*('Session Details'!$D:$D=C$3),0)))

Which is working well, as it finds the 10:00 AM Marketing Session occurring on Monday, September 9 and returns the Session Name:

enter image description here

What I can't figure out how to do (if possible), is to then pull in the remaining relevant data for that session (i.e. Start Time, End Time, Presenters, Location) to also populate the cell.

Ideally, I would want it to look like it does on the "End Goal" sheet (see below) and span the entire length of the session (from 10:00 AM to 11:00 AM):

enter image description here

Any way to utilize the INDEX MATCH formula I have currently to pull in other relevant data from the same row and ideally display it in a readable format (merged cell or not)?


Solution

  • Here's one formulaic approach which you may adapt accordingly (does not give your idealistic expected output of merged style thing though; hopefully someone will contribute via a script):

    =map(A4:A69,lambda(Ξ,map(C3:E3,lambda(Γ,let(Λ,'Session Details'!A2:index('Session Details'!H:H,match(,0/('Session Details'!A:A<>""))),Σ,lambda(x,choosecols(Λ,x)),
     ifna(filter(Σ(5)&char(10)&to_text(Σ(2))&" - "&to_text(Σ(3))&char(10)&Σ(6)&char(10)&Σ(8), Σ(2)=Ξ, Σ(4)=Γ, Σ(1)=C2)))))))
    

    enter image description here