Search code examples
checkboxgoogle-sheetsgoogle-sheets-formulagoogle-sheets-querygoogle-query-language

How to make a Google query pull only TRUE values from two different columns


I am having trouble creating a query to pull only TRUE values from two specified columns. On the Data tab I only want data to populate in the query if either columns 10 or 11 contain TRUE values. For some reason the query is pulling data that contains no True values in columns 10 or 11. The query also seems to only be reading values in column 10 and not column ll. If a user (Rep A or Rep B) selects a true value on in column 10 or 11 (checks box) I want those companies to populate on the Data tab.

Not sure what to try. Copy of workbook shared below.

https://docs.google.com/spreadsheets/d/14CxxGfL1XJX0hMH4G6N8Ghm6m1cHtYx-gfbL2tiJOOU/edit?usp=sharing


Solution

  • =QUERY({'Rep A'!A3:AC;'Rep B'!A3:AC},
     "select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col20 
      where Col10 = TRUE 
         or Col11 = TRUE", 1)
    

    0

    spreadsheet demo