Table of Contents
The SUM function in Google Sheets is a useful tool for quickly calculating the sum of a range of cells. In order to use this function in a query, simply include the range of cells you want to sum in the SELECT clause of your query and precede it with the word “SUM”. This will return the total sum of the selected cells in your query results. The SUM function can also be combined with other functions and criteria in the query to further refine the results. Overall, the SUM function in Google Sheets makes it easy to perform quick and accurate calculations within a query.
Google Sheets Query: Use the SUM Function
You can use the SUM() function in a Google Sheets query to find the sum of values in rows that meet certain conditions.
Method 1: Sum All Rows
=QUERY(A1:C13,"select sum(C)")
Method 2: Sum Rows that Meet One Criteria
=QUERY(A1:C13,"select sum(C) where B>100")
Method 3: Sum Rows that Meet Multiple Criteria
=QUERY(A1:C13,"select sum(C) where A='Mavs' OR B>100") =QUERY(A1:C13, "select sum(C) where A='Mavs' AND B>100")
The following examples show how to use each of these methods in practice.
Method 1: Sum All Rows
We can use the following formula to sum the total points scored by all teams:

We can see that the teams scored a total of 1,141 points.
Example 2: Sum Rows that Meet One Criteria
We can use the following formula to sum the total points scored by teams who had less than 30 rebounds:

The total points scored by teams who had less than 30 rebounds was 679.
Example 3: Sum Rows that Meet Multiple Criteria

The sum of the rebounds among teams that meet either of these criteria is 84.
The following tutorials explain how to perform other common operations with Google Sheets queries:
Cite this article
stats writer (2024). How can I use the SUM function in a Google Sheets query?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-sum-function-in-a-google-sheets-query/
stats writer. "How can I use the SUM function in a Google Sheets query?." PSYCHOLOGICAL SCALES, 16 May. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-sum-function-in-a-google-sheets-query/.
stats writer. "How can I use the SUM function in a Google Sheets query?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-sum-function-in-a-google-sheets-query/.
stats writer (2024) 'How can I use the SUM function in a Google Sheets query?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-sum-function-in-a-google-sheets-query/.
[1] stats writer, "How can I use the SUM function in a Google Sheets query?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, May, 2024.
stats writer. How can I use the SUM function in a Google Sheets query?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
