how to Average Visible Cells Only
SUBTOTALS is for that. See its 1xx function indexes that ignore hidden values (101 is for AVERAGE).