Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
sot sot is offline
external usenet poster
 
Posts: 19
Default countif & subtotal functions

I need the ability of both of these functions but combined. I would like to
be able to count if All or Tops appears in my filtered list without having to
filter on the column that contains these values.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default countif & subtotal functions

One possible way:

If there might be other words in the cell in addition to "All" or "Tops"
then you can use a wildcard as follows.
=COUNTIF(A1:A20,"*All*")+COUNTIF(A1:A20,"*Tops*")

However, you mentioned this was already a filtered list. Your results will
include the filtered data if the criteria matches.
If the cells that contain "All" or "Tops" will not have any other words in
them, then you should be able to use SUMPRODUCT.
You'll need to include the criteria that you used to filter your list.

=SUMPRODUCT(--(A1:A20="All")+(A1:A20="*Tops*"),--(B1:B20="FilteredCriteria"))

HTH,
Paul

--

"sot" wrote in message
...
I need the ability of both of these functions but combined. I would like
to
be able to count if All or Tops appears in my filtered list without having
to
filter on the column that contains these values.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default countif & subtotal functions

But if the cell contains both All and Tops, won't your formulae double-count
them?

And isn't your first double unary minus in the SUMPRODUCT unnecessary, as
the addition would already do the coercing of booleans to a number?
--
David Biddulph

"PCLIVE" wrote in message
...
One possible way:

If there might be other words in the cell in addition to "All" or "Tops"
then you can use a wildcard as follows.
=COUNTIF(A1:A20,"*All*")+COUNTIF(A1:A20,"*Tops*")

However, you mentioned this was already a filtered list. Your results
will include the filtered data if the criteria matches.
If the cells that contain "All" or "Tops" will not have any other words in
them, then you should be able to use SUMPRODUCT.
You'll need to include the criteria that you used to filter your list.

=SUMPRODUCT(--(A1:A20="All")+(A1:A20="*Tops*"),--(B1:B20="FilteredCriteria"))

HTH,
Paul

--

"sot" wrote in message
...
I need the ability of both of these functions but combined. I would like
to
be able to count if All or Tops appears in my filtered list without
having to
filter on the column that contains these values.





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default countif & subtotal functions

Good points David. I did not consider that both words may appear in the
same cell. However, I think it would be safe to say that the column would
not contain multiple words and therefore a SUMPRODUCT command would be the
way to go. I used the double urnary due to habbit. As you know, you are
correct that the addition takes care of converting booleans to a number.
But I also read somewhere that though using an operator such as 1*TRUE will
force the boolean to a number, the double urnary indicates to knowledgable
users that you are forcing a conversion and not necessarilly trying to
calculate something.

In any case, your point allowed me to notice a mistake in my formula.
It should be:
=SUMPRODUCT((A1:A20="All")+(A1:A20="Tops"),--(B1:B20="FilteredCriteria"))

Thanks for the information.
Regards,
Paul


--

"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
But if the cell contains both All and Tops, won't your formulae
double-count them?

And isn't your first double unary minus in the SUMPRODUCT unnecessary, as
the addition would already do the coercing of booleans to a number?
--
David Biddulph

"PCLIVE" wrote in message
...
One possible way:

If there might be other words in the cell in addition to "All" or "Tops"
then you can use a wildcard as follows.
=COUNTIF(A1:A20,"*All*")+COUNTIF(A1:A20,"*Tops*")

However, you mentioned this was already a filtered list. Your results
will include the filtered data if the criteria matches.
If the cells that contain "All" or "Tops" will not have any other words
in them, then you should be able to use SUMPRODUCT.
You'll need to include the criteria that you used to filter your list.

=SUMPRODUCT(--(A1:A20="All")+(A1:A20="*Tops*"),--(B1:B20="FilteredCriteria"))

HTH,
Paul

--

"sot" wrote in message
...
I need the ability of both of these functions but combined. I would like
to
be able to count if All or Tops appears in my filtered list without
having to
filter on the column that contains these values.







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtotal with two functions Compare Values Excel Discussion (Misc queries) 2 January 21st 08 07:28 PM
COUNTIF & SUBTOTAL Dickie Worton Excel Worksheet Functions 2 October 31st 07 10:26 AM
subtotal functions Louise Excel Worksheet Functions 6 February 1st 07 08:51 PM
but < subtotal (3,...) or countif PAR Excel Worksheet Functions 3 April 22nd 06 10:48 AM
Subtotal And Countif Sheryl Excel Discussion (Misc queries) 4 December 9th 04 07:18 PM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"