Steven
Steven

Reputation: 13

Google Sheet query where literal string contains field value

Let's say you have a table of properties in a Google Sheet...

Col A (Name)
Property 1
Property 2
Property 3
Property 4
Property 5

... and you want a formula-driven solution that pulls data on certain properties, specified by a comma-separated literal string like "Property 2,Property 5".

The query() function comes to mind, which uses mySQL syntax. I tried these WHERE queries:

Is there some other query to find the needle in the haystack, where the haystack is a literal string and the needle is a field in the query?

Upvotes: 1

Views: 1355

Answers (1)

player0
player0

Reputation: 1

try:

=QUERY(A:A; "select A where A matches 'Property 2|Property 5'"; )

Upvotes: 1

Related Questions