Countif function

G

Guest

Hi
I have the following formula in one of the cell
=COUNT(IF((TRIM($C$4:$C$96)="P")*ISBLANK($M$4:$M$96),$A$4:$A$96))
because I am calculating number of rows where column 'c' has value 'p' and
colimn 'm' is blank.
But I have autofilter command using VBA code and I want the rows to be
counted based on the output of the filter results.
Example column 'N' has a filter where the selection is 'A' & 'B'.
I want the my formula
COUNT(IF((TRIM($C$4:$C$96)="P")*ISBLANK($M$4:$M$96),$A$4:$A$96)) to count
only filtered rows if the filter is used
 
P

Peo Sjoblom

Please refrain from multiposting, I already gave you an answer yesterday
that let you do this



--


Regards,


Peo Sjoblom
 
S

Sandy Mann

Use the SUBTOTAL() function with 2 as the 1st argument and it will only
count the visible rows with numbers.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top