Search code examples
google-sheets-formulagoogle-query-language

Query formula if cell values match W/and statement Google Sheets


I am trying to query a range but I am not getting the entire range I expect

=query(test!$A$1:$C, "select * where B<>'person-person' and A='"&E2&"'", 1) enter image description here

I get

enter image description here

But I expect

enter image description here

I can not get why the query is not posting back the expected results

A Google Sheet with the test data

Thanks


Solution

  • I got it. No need for a helper column

    =QUERY(test!A1:C,"SELECT * WHERE (B <> 'person-person' and C is not null) or (C is null)")