Google Sheets Sum of Filtered Column: 3 Easy Ways

How-to basics · Updated November 23, 2026

To sum a filtered column in Google Sheets, use the SUBTOTAL function with function number 109 (for SUM), like this: =SUBTOTAL(109, A2:A100). This formula ignores rows hidden by a filter and only adds the visible cells, which is exactly what you need after applying a filter to your data.

Why SUM Doesn’t Work on Filtered Data

The regular SUM function in Google Sheets adds every cell in the range you give it, whether the row is visible or hidden. When you apply a filter, hidden rows are still part of the range, so =SUM(A2:A100) returns the total of all rows, not just the ones you see. This is a common source of confusion, especially for people who are new to spreadsheets. The SUBTOTAL function was created specifically to handle this problem—it can ignore hidden rows depending on the function number you use.

How SUBTOTAL Works in Google Sheets

SUBTOTAL takes two arguments: a function number and a range. The function number tells Google Sheets which operation to perform (SUM, AVERAGE, COUNT, etc.) and whether to ignore hidden rows. For summing filtered data, you use 109 (SUM ignoring hidden rows). Here are the key numbers:

  • 101 – AVERAGE (ignores hidden rows)
  • 103 – COUNTA (ignores hidden rows)
  • 109 – SUM (ignores hidden rows)

If you use 9 instead of 109, the function includes hidden rows, which is not what you want for a filtered column. The numbers 1–11 include hidden rows; 101–111 ignore them. This is a key distinction to remember.

Step-by-Step: Sum a Filtered Column with SUBTOTAL

  1. Select the column header and apply a filter by clicking the filter icon in the toolbar (or Data > Create a filter).
  2. Click the filter icon in the column header and uncheck the values you want to hide, then click OK.
  3. Click an empty cell where you want the sum to appear.
  4. Type =SUBTOTAL(109, A2:A100) (adjust the range to match your data).
  5. Press Enter. The cell shows the sum of only the visible rows.

For example, if you have sales amounts in A2:A50 and you filter to show only rows where the region is “West,” the formula returns the total of those visible rows. If you change the filter, the result updates automatically.

Using AGGREGATE as an Alternative

Google Sheets also has an AGGREGATE function that can do the same thing, but it’s more flexible because it lets you ignore errors and hidden rows at the same time. The syntax is =AGGREGATE(9, 5, A2:A100) where 9 means SUM and 5 means ignore hidden rows and error values. This is useful if your column contains errors like #DIV/0! that you want to skip. However, SUBTOTAL is more commonly used and easier to remember, so most users stick with it.

Summing Filtered Data with QUERY or FILTER

If you prefer a more advanced approach, you can use the FILTER function combined with SUM to sum only rows that meet specific criteria, without needing to manually filter the sheet. For example, to sum sales in column B where the region in column A is “West,” use =SUM(FILTER(B2:B50, A2:A50="West")). This works even if you haven’t applied a filter to the sheet. Similarly, the QUERY function can do this: =QUERY(A2:B50, "select sum(B) where A='West'", 0). These are more powerful when you need to sum based on conditions, but they don’t update automatically when you change a filter on the sheet—they are based on the criteria you type.

Common Problems and How to Fix Them

  • SUBTOTAL returns 0: Make sure you’re using 109, not 9. Also check that the range is correct and that there are no non-numeric values in the range.
  • SUM still includes hidden rows: You might be using the regular SUM. Switch to SUBTOTAL.
  • Filter doesn’t hide rows: Ensure you have a filter applied (Data > Create a filter) and that you’ve unchecked values in the column’s filter dropdown.
  • SUBTOTAL ignores manually hidden rows: SUBTOTAL with 109 ignores rows hidden by filters, but not rows hidden by right-clicking and choosing “Hide row.” To include manually hidden rows, use 9 instead, or use AGGREGATE with option 5.

Comparing SUBTOTAL, AGGREGATE, and FILTER

Each method has its strengths. SUBTOTAL is the simplest and updates instantly with filter changes. AGGREGATE is more robust if you have errors in your data. FILTER + SUM is best when you want to sum based on criteria without manually filtering the sheet. Here’s a quick comparison:

  • SUBTOTAL: Easy, updates with filters, ignores hidden rows (with 109).
  • AGGREGATE: Can ignore errors, more options, but less common.
  • FILTER: No need to filter the sheet, but criteria are fixed in the formula.

For most everyday tasks, SUBTOTAL is the recommended choice because it’s straightforward and works exactly as expected.

Frequently Asked Questions

Does SUBTOTAL work in Excel too?

Yes, SUBTOTAL works the same way in Microsoft Excel, but Excel also has the AGGREGATE function that is similar. In Google Sheets, the function names and syntax are identical, so you can use the same formula in both.

How do I sum a filtered column with multiple criteria?

If you have multiple criteria, you can either filter the sheet using multiple column filters and then use SUBTOTAL, or use SUM(FILTER()) with multiple conditions, like =SUM(FILTER(B2:B50, (A2:A50="West")*(C2:C50>100))). The multiplication acts as an AND operator.

Why does my SUBTOTAL formula show a #VALUE! error?

This usually happens if the range contains text or blank cells that can’t be summed. Check that all cells in the range are numbers. You can also use SUMIF or AGGREGATE to handle errors.

Can I use SUBTOTAL in a pivot table?

Pivot tables have their own subtotal feature. You can right-click a value in a pivot table and choose “Show as” or “Summarize by” to sum filtered data. SUBTOTAL is not needed inside a pivot table.

How do I sum only visible rows without filtering?

If you have manually hidden rows (not via filter), use =SUBTOTAL(109, A2:A100)—it ignores rows hidden by right-clicking as well. If you want to ignore rows hidden by a filter, 109 works too. To include manually hidden rows, use 9.

Does SUBTOTAL recalculate automatically when I change the filter?

Yes, SUBTOTAL recalculates automatically whenever you change the filter criteria, because it’s a volatile function that responds to changes in the visible range.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.