m-80
m-80

Reputation: 63

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?

Upvotes: 0

Views: 48

Answers (2)

player0
player0

Reputation: 1

=FILTER(A2:A,         B2:B  <=         DATE(2018, 2, 1), 
 IF(C2:C="", TODAY(), C2:C) >= EOMONTH(DATE(2018, 2, 1), 0))

0


if you want just L M use (eg. to remove blanks from C):

=FILTER(A2:A, B2:B <=         DATE(2018, 2, 1), 
              C2:C >= EOMONTH(DATE(2018, 2, 1), 0))

Upvotes: 0

Beno&#238;t W&#233;ry
Beno&#238;t W&#233;ry

Reputation: 862

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

enter image description here

Upvotes: 1

Related Questions