Search code examples
google-sheetsgoogle-sheets-formulaarray-formulas

Google Sheets query ("SELECT A WHERE B <> '0'")


I have a table for event planning where A is the items and B is the quantities.

I then want it to turn into a list where it just has the items if B is more than 0. I have tried using =QUERY(Job!A3:B16, SELECT A WHERE B <> '0') but I get #VALUE! back and the error pop up says

In Array Literal, an Array Literal was missing values for one or more rows.

Is there a better formula to use or a better way to use this?


Solution

  • Try

    =QUERY(Job!A3:B16, "SELECT A WHERE B <> 0 ")
    

    you can also use FILTER

    =FILTER(Job!A3:A16,Job!B3:B16<>0)