1

Writing a Google Sheet for personal expenses I am trying to create a query to sum the expenses of a type, but the editor is retrieving a parse error that I can't achieve the logs (not sure it is possible).

Please consider only rows below row 15.

On Cell B9 I'd like to sum every expense of type Saúde. Can you help me understand what I am doing wrong?

D column represents the amount of the expense.

C column represents the type of the expense.

Query: =QUERY(C16:C1000,"select sum(D) where C = 'Saúde'")

enter image description here

(Plus) Curiosity apart: is possible to set up the sheet to write some rows and then the sheet push below rows to beneath then I could write the data ever on the top instead at the last row bottom?

player0
  • 124,011
  • 12
  • 67
  • 124
Augusto
  • 3,825
  • 9
  • 45
  • 93

1 Answers1

1

use:

=QUERY(C16:D1000; "select sum(D) where C = 'Saúde'"; )

see (not): https://stackoverflow.com/questions/73767719/locale-differences-in-google-sheets-documentation-missing-pages

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124
  • Once did it, the error goes away but I am seeing only the string "sum" instead the sum of the values, on the cell. – Augusto Jan 11 '23 at 14:02
  • Update: I realized that the query's result value has written below row, how to put the query's value on the same row I typed the query? – Augusto Jan 11 '23 at 14:14
  • 1
    @Augusto use: `=QUERY(C16:D1000; "select sum(D) where C = 'Saúde' label sum(D)''"; )` – player0 Jan 11 '23 at 14:30