If you're using the Autofilter feature, you're probably wondering how to perform calculations on only those values that are being displayed by the filter. The SUBTOTAL() function is the answer.
The syntax of the SUBTOTAL() function is as follows:
=SUBTOTAL(function_num, ref1, ref2...)
where function_num determines what the calculation should be (see below) and ref1, ref2 etc is the range of cells to be calculated.
Possible values for function_num are as follows:
