In Google Sheets, I have the following data:
| A | B 1 | foo | 20 2 | bar | 50 3 | baz | -40 5 | bar | -50 4 | foo | 100 6 | baz | 60
Currenly, I'm using this query formula:
=QUERY(index(A2:B1000);"select A, sum(B) where A is not null and B is not null group by A order by sum(B) desc";)
But it outputs values, where the sum of B is equal to 0.
So desired output would be:
| A | B 1 | foo | 120 2 | baz | 20
How can I achieve that?
Also, is there a better way than A2:B1000
for selecting the whole range (except the first row)?