Search code examples
arraysgoogle-sheetsnested-listsgoogle-sheets-querygoogle-query-language

How to query a list of (course) dates and return two rows for each date - to create two sessions on each of the course dates


I'm using Google Sheets to build a schedule for several courses. The course dates are all set for the year and are the same for each course. Therefore I can pull the course dates for each course from a master list of course dates.

However, with one instance of this schedule (i.e. one course), the course has two sessions for each course, whereas I can currently only query and return one row for each course date. So I'm trying to build a nested query (I think) to return two (or maybe 3) rows for each course date, ordered by date.

I've searched for nested queries, but am not too familiar with them, hence cannot find anything which helps me resolve this problem.

Here is a test sheet with some data.

Many thanks. Martin


Solution

  • try:

    =QUERY({CourseDates!B2:R; CourseDates!B2:R},
     "select Col1,Col5,Col4,Col8 
      where Col8 contains 'Lecture Day FULL'
      order by Col1")
    

    enter image description here