A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Countif excluding hidden rows



 
 
Thread Tools Display Modes
  #1  
Old September 19th, 2008, 05:44 PM posted to microsoft.public.excel.worksheet.functions
qh8519a
external usenet poster
 
Posts: 4
Default Countif excluding hidden rows

I would like to count the total number of "1"s and "2"s across a range of
(b8:cu30000). I have an autofilter set up and I would only like to count the
exposed rows. I would like to exclude the rows hidden by the autofilter.
When I use the countif function, it includes the hidden rows. Any help would
be appreciated.

Thanks
Drew
  #2  
Old September 19th, 2008, 05:53 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default Countif excluding hidden rows

If you filter and only want to count visible rows you can use

=SUBTOTAL(3,A2:A500)

If you want some extra criteria for the visible cells


=SUMPRODUCT(--($A$2:$A$500=1),(SUBTOTAL(3,OFFSET($A$2,ROW($A$2:$ K$500)-MIN(ROW($A$2:$$500)),,))))

for 1


=SUMPRODUCT(--(($A$2:$A$500=1)+($A$2:$A$500=2)0),(SUBTOTAL(3,OF FSET($K$2,ROW($A$2:$A$500)-MIN(ROW($A$2:$A$500)),,))))


for 1 or 2



--


Regards,


Peo Sjoblom

"qh8519a" wrote in message
...
I would like to count the total number of "1"s and "2"s across a range of
(b8:cu30000). I have an autofilter set up and I would only like to count
the
exposed rows. I would like to exclude the rows hidden by the autofilter.
When I use the countif function, it includes the hidden rows. Any help
would
be appreciated.

Thanks
Drew



  #3  
Old September 19th, 2008, 06:02 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Countif excluding hidden rows

For that big of a range you should add a column that counts those values by
row.

Enter this formula in CV8 and copy down to CV30000:

=SUM(COUNTIF(B8:CU8,{1,2}))

Then:

=SUBTOTAL(9,CV8:CV30000)

--
Biff
Microsoft Excel MVP


"qh8519a" wrote in message
...
I would like to count the total number of "1"s and "2"s across a range of
(b8:cu30000). I have an autofilter set up and I would only like to count
the
exposed rows. I would like to exclude the rows hidden by the autofilter.
When I use the countif function, it includes the hidden rows. Any help
would
be appreciated.

Thanks
Drew



  #4  
Old September 19th, 2008, 06:17 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Countif excluding hidden rows

Ooops!

I see you wanted a COUNT not a sum.

Change the formula in CV8 to:

=--(SUM(COUNTIF(B8:CU8,{1,2}))0)


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
For that big of a range you should add a column that counts those values
by row.

Enter this formula in CV8 and copy down to CV30000:

=SUM(COUNTIF(B8:CU8,{1,2}))

Then:

=SUBTOTAL(9,CV8:CV30000)

--
Biff
Microsoft Excel MVP


"qh8519a" wrote in message
...
I would like to count the total number of "1"s and "2"s across a range of
(b8:cu30000). I have an autofilter set up and I would only like to count
the
exposed rows. I would like to exclude the rows hidden by the autofilter.
When I use the countif function, it includes the hidden rows. Any help
would
be appreciated.

Thanks
Drew





  #5  
Old September 19th, 2008, 06:22 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Countif excluding hidden rows

Well DUH!

LOL!

I'll get it right one of these times (I hope!)

Disregard my previous reply.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Ooops!

I see you wanted a COUNT not a sum.

Change the formula in CV8 to:

=--(SUM(COUNTIF(B8:CU8,{1,2}))0)


--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
For that big of a range you should add a column that counts those values
by row.

Enter this formula in CV8 and copy down to CV30000:

=SUM(COUNTIF(B8:CU8,{1,2}))

Then:

=SUBTOTAL(9,CV8:CV30000)

--
Biff
Microsoft Excel MVP


"qh8519a" wrote in message
...
I would like to count the total number of "1"s and "2"s across a range of
(b8:cu30000). I have an autofilter set up and I would only like to
count the
exposed rows. I would like to exclude the rows hidden by the
autofilter.
When I use the countif function, it includes the hidden rows. Any help
would
be appreciated.

Thanks
Drew







 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.