I want to get a subset of data from another tab. Eventually, this will become a script and pull data from a different sheet.
I can use QUERY
to get all the data available, but I only want to return rows where column C contains a specific value. This lookup value is currently held in a range, so it seems I should be able to use MATCH
inside the QUERY
.
In the above test, I have checked that MATCH
works on the lookup range:
=MATCH("Sandra",VisitPeople, 0)
(returns 2)
and that QUERY
with a similar Where clause returns a superset of data:
=QUERY('Contact details'!A1:AX, "select C,D,E where B = 'Volunteer' and E <> ''", 1)
(returns list of names)
but when I try to put the two together, I get an error:
=QUERY('Contact details'!A2:AX, "select C,D,E where B = 'Volunteer' and MATCH(C,VisitPeople,0) > 0", 1)
(returns Formula parse error.)
How should I pass column C into the MATCH
function?