nabeel
nabeel

Reputation: 961

Google spreasheet filter by string array

I want to create a filter view in my google spreadsheet which shows all rows where column C contains one of the values from a hard-coded set of values.

For example if I have a set like Hotel1, Hotel2, Hotel3 then my filter view should show all rows which have Column C equal to one of these values like Hotel2. And if a row has column C = Hotel4 it should be hidden.

Is it possible to create a filter view that returns true whenever the value of the given column is a substring of another string?

Upvotes: 0

Views: 1542

Answers (1)

ttarchala
ttarchala

Reputation: 4567

In your example, assuming the range to filter is several columns A to Z:

=filter(A:Z, match(C:C, {"Hotel1", "Hotel2"}, 0))

For your second question, same idea:

=filter(A:Z, regexmatch(C:C, "Hotel"))

Upvotes: 1

Related Questions