#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 205
Default CountIF for Data

I would like to count the number of occurances of "Student" only if "Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default CountIF for Data

=SUMPRODUCT(--(A1:A100="Member"),--(B1:B100="Student"))
For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Linda" wrote in message
...
I would like to count the number of occurances of "Student" only if
"Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default CountIF for Data

Sumproduct springs to mind for multiple criteria counts, eg in C1:
=sumproduct((A1:A10="Member")*(B1:B10="Student"))
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,500 Files:370 Subscribers:66
xdemechanik
---
"Linda" wrote:
I would like to count the number of occurances of "Student" only if "Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default CountIF for Data

There must be a better way to do this in a single step, but this will also
work ... in C1 enter:

=IF(AND((A1="Member",B1="Student"),True,False)

then use the countif function to count the number of TRUE values in C.




"Linda" wrote in message
...
I would like to count the number of occurances of "Student" only if
"Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default CountIF for Data

IF you use XL-2007 then try this:

=COUNTIFS(A:A,"Member",B:B,"Student")



"Linda" wrote:

I would like to count the number of occurances of "Student" only if "Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default CountIF for Data

Hi,

Bernard and Max's formulas are effectively the same, however, Bernard's is
prepared to handle a few problems that the other one won't.

But if you just want short:

=SUMPRODUCT(N(A1:A5&B1:B5="MemberStudent"))

or if you enter Member in D1 and Student in D2

=SUMPRODUCT(N(A1:A5&B1:B5=D1&D2))

or you can use the array equivalent:

=SUM(N(A1:A5&B1:B5=D1&D2))

In this case press Shift+Ctrl+Enter to enter the formula rather than Enter.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Linda" wrote:

I would like to count the number of occurances of "Student" only if "Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default CountIF for Data

Bernard and Max's formulas are effectively the same
Bernard's is prepared to handle a few problems that the other one won't.


Such as?

--
Biff
Microsoft Excel MVP


"Shane Devenshire" wrote in
message ...
Hi,

Bernard and Max's formulas are effectively the same, however, Bernard's is
prepared to handle a few problems that the other one won't.

But if you just want short:

=SUMPRODUCT(N(A1:A5&B1:B5="MemberStudent"))

or if you enter Member in D1 and Student in D2

=SUMPRODUCT(N(A1:A5&B1:B5=D1&D2))

or you can use the array equivalent:

=SUM(N(A1:A5&B1:B5=D1&D2))

In this case press Shift+Ctrl+Enter to enter the formula rather than
Enter.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Linda" wrote:

I would like to count the number of occurances of "Student" only if
"Member"
is true. Is COUNT the correct function?

A B
1 Member Student
2 Member Senior
3 Member Student
4 Fundraiser Student
5 Fundraiser Senior



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
Data Form, Macro and Countif helen wheels Excel Worksheet Functions 1 November 23rd 07 10:31 PM
multiple data ranges for countif David G[_2_] Excel Worksheet Functions 4 August 8th 07 04:51 PM
COUNTIF & data validation from a drop down Kelly 1st Excel Discussion (Misc queries) 3 June 6th 07 10:25 AM
How do I COUNTIF from previously counted data? John Excel Worksheet Functions 1 September 13th 06 12:47 AM
Countif data is not all in sequential order heater Excel Discussion (Misc queries) 2 July 28th 05 06:36 PM


All times are GMT +1. The time now is 12:13 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"