PC Review


Reply
Thread Tools Rate Thread

count if on Visible - Filtered

 
 
=?Utf-8?B?dG9ueXY=?=
Guest
Posts: n/a
 
      6th Jul 2007
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)
 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      6th Jul 2007
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

--
Biff
Microsoft Excel MVP


"tonyv" <(E-Mail Removed)> wrote in message
news:1BC58AE5-B6DC-4F2E-B011-(E-Mail Removed)...
> 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)



 
Reply With Quote
 
=?Utf-8?B?Sk1C?=
Guest
Posts: n/a
 
      6th Jul 2007
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)




"tonyv" wrote:

> 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)

 
Reply With Quote
 
=?Utf-8?B?dG9ueXY=?=
Guest
Posts: n/a
 
      7th Jul 2007
Thanks for this. Yes your assumptions were correct.

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

"JMB" wrote:

> 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)
>
>
>
>
> "tonyv" wrote:
>
> > 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)

 
Reply With Quote
 
=?Utf-8?B?Sk1C?=
Guest
Posts: n/a
 
      7th Jul 2007
Thanks for the feedback - sorry about the typo.


"tonyv" wrote:

> Thanks for this. Yes your assumptions were correct.
>
> Did the job once I sorted out your typo, but that was the easy bit.
>
> "JMB" wrote:
>
> > 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)
> >
> >
> >
> >
> > "tonyv" wrote:
> >
> > > 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)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Number of Visible Rows in Filtered View magmike Microsoft Excel Discussion 2 6th Sep 2011 05:51 PM
Count Filtered Visible Items that Match Numeric Criteria between two ranges Sam via OfficeKB.com Microsoft Excel Worksheet Functions 4 20th Sep 2006 06:39 PM
SUBTOTAL Second Count / sub-count of Filtered Visible Cells QTE Microsoft Excel Misc 13 4th Aug 2004 04:47 PM
SUBTOTAL Second Count / sub-count of Filtered Visible Cells QTE Microsoft Excel Worksheet Functions 0 27th Jul 2004 08:47 PM
SUBTOTAL Second Count / sub-count of Filtered Visible Cells QTE Microsoft Excel Worksheet Functions 3 21st Jul 2004 11:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:17 AM.