Countif

S

seibes

I was wondering if there is a way to use countif or something similar
to count only visible cells. I know of subtotal but to the best of my
knowledge there is no countif function tied to subtotal. Basically i
have a column with a yes, no, and an n/a; I need to count how many of
those there are when they are unfiltered and when they are filtered by
other columns in my spreadsheet. Thanks.
 
J

JE McGimpsey

seibes said:
I was wondering if there is a way to use countif or something similar
to count only visible cells. I know of subtotal but to the best of my
knowledge there is no countif function tied to subtotal. Basically i
have a column with a yes, no, and an n/a; I need to count how many of
those there are when they are unfiltered and when they are filtered by
other columns in my spreadsheet. Thanks.

One way:

=SUMPRODUCT(--(rng="yes"),SUBTOTAL(3, OFFSET(rng, ROW(rng) -
MIN(ROW(rng)),,1)))
 
Top