Table of Contents
In order to calculate the sum of filtered rows in Google Sheets, one can use the SUMIF function. This function allows users to specify certain criteria for which rows to include in the sum calculation. For example, if a user wants to calculate the sum of all sales for a particular product, they can filter the data by that specific product and then use the SUMIF function to only include the filtered rows in the sum calculation. Other examples of using the SUMIF function to calculate the sum of filtered rows include calculating the total expenses for a specific category, or the total number of hours worked by a particular employee. This feature in Google Sheets is particularly useful for managing and analyzing large sets of data.
Sum Filtered Rows in Google Sheets (With Examples)
The easiest way to take the sum of a filtered range in Google Sheets is to use the following syntax:
SUBTOTAL(109, A1:A10)
Note that the value 109 is a for taking the sum of a filtered range of rows.
The following example shows how to use this function in practice.
Example: Sum Filtered Rows in Google Sheets
Suppose we have the following spreadsheet that contains information about various basketball teams:

To add a filter to this data, we can highlight cells A1:B10, then click the Data tab, then click Create a filter:

We can then click the Filter icon at the top of the Points column and uncheck the box next to the first three values 84, 89, and 93:

Once we click OK, the data will be filtered to remove these values.
If we attempt to use the SUM() function to sum the points column of the filtered rows, it will actually return the sum of all of the original values:

Instead, we can use the SUBTOTAL() function:

This function takes the sum of only the visible rows.
Sum of Visible Rows: 99 + 94 + 97 + 104 + 109 + 99 = 602.
Cite this article
stats writer (2024). How can I calculate the sum of filtered rows in Google Sheets?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-calculate-the-sum-of-filtered-rows-in-google-sheets-and-what-are-some-examples-of-how-to-do-so/
stats writer. "How can I calculate the sum of filtered rows in Google Sheets?." PSYCHOLOGICAL SCALES, 18 May. 2024, https://scales.arabpsychology.com/stats/how-can-i-calculate-the-sum-of-filtered-rows-in-google-sheets-and-what-are-some-examples-of-how-to-do-so/.
stats writer. "How can I calculate the sum of filtered rows in Google Sheets?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-calculate-the-sum-of-filtered-rows-in-google-sheets-and-what-are-some-examples-of-how-to-do-so/.
stats writer (2024) 'How can I calculate the sum of filtered rows in Google Sheets?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-calculate-the-sum-of-filtered-rows-in-google-sheets-and-what-are-some-examples-of-how-to-do-so/.
[1] stats writer, "How can I calculate the sum of filtered rows in Google Sheets?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, May, 2024.
stats writer. How can I calculate the sum of filtered rows in Google Sheets?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
