View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Steve Simons Steve Simons is offline
external usenet poster
 
Posts: 15
Default REPOST: Count certain records in filtered data

Hi Dave


Thanks for the advice. I've obviously not explained this clearly
enough. The subtotal you descibe is working fine, but isn't what I
want. I want the number of visible (non-empty) cells that contain the
word "Accounts"

In the example below =subtotal(3,a3:a65536) would return 10

DEPARTMENT GENDER
Accounts F
Accounts F
Accounts M
Accounts M
Administration M
Administration F
Computer M
Credit Control M
Maintenance F
Management M

If I then filter the data on the Gender column, for F only, I want the
subtotal to return 2 - the number of visible entries in column A that
contain the word Accounts.


DEPARTMENT GENDER
Accounts F
Accounts F
Administration F
Maintenance F

Thanks again

Steve



On Fri, 18 Aug 2006 08:01:13 -0500, Dave Peterson
wrote:

Are you actually filtering to hide the rows with male in that column?

Or are you just hiding those rows?

I've never seen =subtotal() make a mistake in counting visible data.

I put my =subtotal() formulas in Row 1
my headers in row 2
and my data in Rows 3:xxxx
(No other stuff below my data)

And my subtotal formulas look like:

=subtotal(3,a3:a65536)
to count the number of visible (Non-empty) entries in that column.

====
If you're using xl2003 and have hidden the rows manually, you can use:
=subtotal(103,a3:a65536)


Steve Simons wrote:

Hi

I have seen how to use subtotal to count or sum filtered data, which
is great, but I can't find the answer to what I need to do:-

I have filtered data. Let's say in column A I have departments listed,
with 20 occurences of the department "Accounts". When I filter the
data on another field (say column B, the "Gender" column, looking for
only Females who work at the company), only 15 occurrences of
"Accounts" are visible.

I need to be able to count only the VISIBLE occurences of "Accounts"
(i.e. 15 of them) within the filtered data. If I use subtotal for this
I get 20 returned, when the answer should be 15.

How can I get it to show me the 15 visible records "Accounts" for this
data, filtered on Gender of "Female" ??

TIA

Steve