count if on Visible - Filtered

G

Guest

Hi,

I'm trying to get a simple conditional formula to work when I Auto Filter.

How can this be done?

I need to calculate the percentage of visible cells that have 1 in them of
the total visible cells

=COUNTIF(G9:G99,1)/COUNTA(G9:G99)
 
T

T. Valko

Filtered range is A2:B15

Filtered on column A with column B containing some 1's:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(B2:B15,ROW(B2:B15)-MIN(ROW(B2:B15)),,1)),--(B2:B15=1))/SUBTOTAL(3,A2:A15)

Format as PERCENTAGE
 
G

Guest

Assuming your data is in G9:G99 as indicated (G8 is a header), try

=SUMPRODUCT(--(G9:G99=1),SUBTOTAL(3,OFFSET(G9,ROW(G9:G99)-ROW(G9),)))/SUBOTAL(3,G9:G99)
 
G

Guest

Thanks for this. Yes your assumptions were correct.

Did the job once I sorted out your typo, but that was the easy bit.
 
G

Guest

Thanks for the feedback - sorry about the typo.


tonyv said:
Thanks for this. Yes your assumptions were correct.

Did the job once I sorted out your typo, but that was the easy bit.
 

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