Home > Net >  Using query in google sheet to call certain rows
Using query in google sheet to call certain rows

Time:05-23

Hi everyone,

I want to get all the rows where A=1, A=2. The query is very simple but I'm not sure why there is no output. I guess is the problem of the format for column A but I'm not sure what should I change in my formula so that the formula can work. Appreciate any help or advice!

CodePudding user response:

A can't be both: 2 and 1. Instead try

=query(A3:C, "Where A = 2 or A = 1", 0)

CodePudding user response:

It should have been OR not AND - it's impossible for any row in a particular column to have two values simultaneously:

=query(A3:C,"select * where A=1 or A=2",0)

enter image description here

CodePudding user response:

QUERY() is good choice. You can also use FILTER() function like-

=FILTER(A3:C,A3:A>=1,A3:A<=2)
  • Related