How to Sum Filtered Rows in Google Sheets

To sum filtered rows in Google Sheets, you can use the SUBTOTAL function. The SUBTOTAL function allows you to perform calculations on visible cells only, ignoring any hidden or filtered cells.

Here's how to use the SUBTOTAL function to sum filtered rows:

  1. Click on an empty cell where you want to display the sum of the filtered rows.
  2. Type the following formula: =SUBTOTAL(9, range), where range is the range of cells you want to sum. For example, if you want to sum values in column A from row 2 to row 100, you would use the formula =SUBTOTAL(9, A2:A100).
  3. Press Enter.

Now, the cell will display the sum of the visible rows in the specified range, ignoring any hidden or filtered rows.

Example

Let's say you have a dataset in columns A and B, where column A contains the sales values, and column B contains the region for each sale. You want to sum the sales values only for the visible rows after applying a filter to column B.

  1. Select the entire data range, including headers, in this case, A1:B10.
  2. Click the "Data" tab in the menu.
  3. Click "Create a filter" to apply a filter to the selected range.
  4. Click the filter icon in the header of column B, and select the regions you want to display, then click "OK" to apply the filter.
  5. Click on an empty cell, for example, C1, to display the sum of the filtered sales values.
  6. Type the formula =SUBTOTAL(9, A2:A10) and press Enter.

Now, cell C1 will show the sum of the visible sales values in column A, ignoring any hidden or filtered rows.

Did you find this useful?