Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
How do I use both a cell and a column as function parameters inside a query?
Post Flair (click to view more posts with a particular flair)
Post Body

My idea is quite simple, make a query and use both an external cell and a column from within the query range as parameters of a function.

As an example, this is the given sheet:

1 10 1
2 20
3 30
4 40
5 50

And those were the ways I tried out and their results:

QUERY(A1:B5; "select sum(b) where "&EQ(C1;&"A"&)&"=true"; 0)

This one throws a function error.

QUERY(A1:B5; "select sum(b) where "&EQ(C1;A)&"=true"; 0)

This one says A is an unknown name.

QUERY(A1:B5; "select sum(b) where "&EQ(C1;A1)&"=true"; 0)

This return the sum of all values in column B (150), meaning no rows were filtered.

The expected result was for the query function read all rows and filter any where the value in column A is not equal to C1.

Is something like that achievable?

Edit: Okay, so there is a solution using ArrayFormula and concatenating it with the Query range:

QUERY({A1:B5,ARRAYFORMULA(EQ(C1,A1:B5))}; "select sum(Col2) where (Col3=true)"; 0)

This should work, but I'll keep it open until we find a solution using Query and EQ as previously intended.

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
23,030
Link Karma
1,561
Comment Karma
19,365
Profile updated: 1 week ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago