Silverman
Silverman

Reputation: 307

Filter by several possible values in a single condition in Google Sheets

Long story short, I want to perform a filter on column A (task ID) with several possible values of column B (assignees), but I don't want to place those possible values in separate conditions (in case I want to pass an array with the possible values for the filter). For example:

FILTER(A2:A15, EXACT(B2:B15,J1)+EXACT(B2:B15,K1))

Where J1 = "Jack" and K1 = "Jones". But if I merge the two conditions (because I have a lot of possible correct values):

FILTER(A2:A15, EXACT(B2:B15,J1:K1))

then Exact outputs a two dimensional boolean array which causes a #VALUE error on the filter operation stating FILTER range must be a single row or a single column.

enter image description here

Upvotes: 0

Views: 202

Answers (1)

Mike Steelson
Mike Steelson

Reputation: 15328

You can do with query

=query( A1:B,"select A where B matches '"&join("|",J1:K1)&"' ")

Upvotes: 2

Related Questions