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.
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.
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/googlesheet...