Is it possible to sum a range of cells while ignoring rows which are not hidden?
I'm not sure if you necessarily require a Google Apps Script solution; the tags you have used suggest that a spreadsheet formula might be adequate. If this is the case, then it is definitely possible to achieve this using SUBTOTAL.
will sum all cells in column A that are not hidden.
109 is the
function_code which consists of 9 for SUM, prepended with 10 so hidden values will be skipped.
Your question requests that the sum should be "ignoring rows that are not hidden", which, I believe, is equivalent to "sum the hidden rows". This may be achieved using:
Turns out its not possible (for now).