Google-sheets – Filter for a QUERY function

formulasgoogle sheetsgoogle-sheets-filtergoogle-sheets-query

I need some help here.
So I need a function which imports selected columns from a different sheet out of which one of them contains a specified word but allows you to filter/ignore based on specified words

And here's the example sheet: https://docs.google.com/spreadsheets/d/1brWG_lbvqQUDT5x9ZGmxFKYUu6ByQ56SPi9Y9C21WBQ/edit#gid=1683245951

And this is the QUERY Function:
=query(Sheet1!A:F, "SELECT A, B, C, D, E, F where (E contains 'Apple')")

Thank you for any help.

Best Answer

You would just use and

The only column containing a different variable is column B. So you could use

=query(Sheet1!A:F, "SELECT A, B, C, D, E, F where E contains 'Apple' and B contains 'had'")

Note:
you do not need the parentheses around E contains 'Apple'