user3453081
user3453081

Reputation: 3

Countif for filtered rows

Trying to count yes values in a column with autofiltered rows. Countif gives me result for total range and does not adjust to filtered rows like subtotal. Any ideas?

Upvotes: 0

Views: 369

Answers (1)

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60224

Try the following: Adjust the range to reflect the appropriate column:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(A2:A20,ROW(A2:A20)-ROW(A2),0,1))*(A2:A20="Yes"))

Upvotes: 4

Related Questions