weizer
weizer

Reputation: 1117

Using query in google sheet to call certain rows

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!

Upvotes: 0

Views: 75

Answers (3)

Harun24hr
Harun24hr

Reputation: 36840

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

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

Upvotes: 2

Tom Sharpe
Tom Sharpe

Reputation: 34180

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

Upvotes: 2

JPV
JPV

Reputation: 27242

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

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

Upvotes: 3

Related Questions