This is a job for theSUBTOTAL function.

SUBTOTAL can perform a variety of calculations like COUNT, SUM, MAX, MIN, and more.

This makes it ideal for running calculations on the rows thatare visiblein filtered data.

Excel formula: Sum visible rows in a filtered list

Count with SUBTOTAL

The first argument,function_num, specifies count as the operation to be performed.

Note that SUBTOTALalwaysignores values in cells that are hidden with a filter.

Values in rows that have been “filtered out” are never included, regardless offunction_num.

Excel formula: Count visible rows with criteria

If you are hiding rows manually (i.e.

To be clear, values in rows that have been hidden with a filter areneverincluded, regardless offunction_num.

The SUBTOTAL function can perform many other calculations.

Excel SUBTOTAL function

To see a list of all the calculations SUBTOTAL can perform,see this page.

Article image