The SUBTOTAL
function can be used if you want to get the count respecting any filters you use on the page.
=SUBTOTAL(103, A1:A200)
will help you get count of non-empty rows, respecting filters.
103 - is similar to COUNTA
, but ignores empty rows and also respects filters.
Reference : SUBTOTAL function