Google-sheets – Query is putting the result into the row below the formula—how to put in the same cell as the formula

google sheets

I've used this query function to sum data based on conditions from another sheet:

=QUERY(Backlinking!A2:Z1000, "Select Sum(R) where F='performance management tools'")

It returns the correct sum:

enter image description here

but the result is in the cell UNDERNEATH the cell I want to see it in.

How do I make the Query result display in the same cell as the formula?

Best Answer

Query returns result with column name Use this formula if you need only value in that cell

QUERY(Backlinking!A2:Z1000, "Select SUM(R) where F='performance management tools' label SUM(R) ''"))

or

=SUM(QUERY(Backlinking!A2:Z1000, "Select R where F='performance management tools'"))

In this case simple SUMIFS would be enough

=SUMIFS(Backlinking!R2:R1000,Backlinking!F2:F1000,"performance management tools")