My problem
I have a table of id
s and term
s in Google Sheets. I would like to concatenate a few terms by their ids.
For example, (2,3)
should yield Talla de zapato de mujer, Women’s shoe size
. I want to take id list from a separate cell.
So, I tried:
=QUERY(A:B, "SELECT A,B WHERE A=2 OR A=3")
The query works fine, but it's hard to manually extract the 2's and 3's this way.
So I tried:
=QUERY(A:B, "SELECT A,B WHERE A IN (2,3)")
Which does not work (VALUE
error).
My question
How can I select ids from a table using a GSheets query using a few ids written in a different cell?
Best Answer
The
=QUERY()
languageWHERE
clause support regex; so you can "simulate" IN functionality using a regex group - ie: