Without an uploaded example Excel file representative of what you are trying to do it is difficult for me to say.
A shot in the dark, though. If you can live with a helper column I have found that this approach works well. Next to your filtered range try this formula in the first row and fill down. Change the left and right boundaries of your filtered range to suit. Then reference that helper column in formula with value of helper = 1, or reference the entire helper range in an array formula.
Is there a way to write the formula so that the subtotal function works as I filter the data, but it also re-sizes itself as the overall range grows and shrinks?
A Dynamic Named Range (DNR) formula in Name Manager comes to mind. It's topic in itself. There is no shortage of information with query in this forum and many different ways to do it.
Also Tables will grow to accommodate new data, but I don't know how well they get along with this helper column idea or with macros.
Also in SUBTOTAL you need to use the 100 series of function numbers for SUBTOTAL to ignore hidden rows. Try SUBTOTAL(109, <your formula>)
Bookmarks