Search code examples
google-sheetsfiltergoogle-sheets-formulagoogle-sheets-querygoogle-query-language

How to get an array that meets a certain condition and remove blanks?


I have a list of employees in Google sheet with their work start and end dates. It looks like this (sample):

I need to generate a new list out of it, that will have employees, who were employed during a particular month, say February 2018.

In that case the list should look like:

How do I do that? Could you help with the formula?


Solution

  • =query(A1:C,"where B <= date '2018-02-28' and (date '2018-02-01' <= C or C is null)",1)
    

    enter image description here