The result is 7, since there are 7 rows visible out of 10 rows total.

Count with SUBTOTAL

Following the example in the worksheet above, to count the number of non-blank rows visible when a filter is active, use a formula like this: The first argument, function_num, specifies count as the operation to be performed. SUBTOTAL ignores the 3 rows hidden by the filter and returns 7 as a result, since there are 7 rows visible. Note that SUBTOTAL always ignores values in cells that are hidden with a filter. Values in rows that have been “filtered out” are never included, regardless of function_num. If you are hiding rows manually (i.e. right-click > Hide), and not using filter controls , use this version of the formula instead: With the function_num set to 103, SUBTOTAL still performs a count, but this time it will ignore rows that are manually hidden, as well as those hidden with a filter. To be clear, values in rows that have been hidden with a filter are never included, regardless of function_num. The SUBTOTAL function can perform many other calculations. To see a list of all the calculations SUBTOTAL can perform, see this page.

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.