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  

Coutnif



 
 
Thread Tools Display Modes
  #1  
Old September 26th, 2008, 08:59 PM posted to microsoft.public.excel.worksheet.functions
Matt
external usenet poster
 
Posts: 1,077
Default Coutnif

I need help with a countif statement. I have information like the following:

A B
X 1
Y 1
X 2
X 0

I need to count how many times X in column A is greater than zero in column B.
  #2  
Old September 26th, 2008, 09:08 PM posted to microsoft.public.excel.worksheet.functions
Fred Smith[_4_]
external usenet poster
 
Posts: 2,386
Default Coutnif

Countif can handle only one condition. For multiple conditions, use
Sumproduct, as in:

=sumproduct(--(a1:a5="X"),--(b1:b50))

Regards,
Fred.

"Matt" wrote in message
...
I need help with a countif statement. I have information like the
following:

A B
X 1
Y 1
X 2
X 0

I need to count how many times X in column A is greater than zero in
column B.


  #3  
Old September 26th, 2008, 09:11 PM posted to microsoft.public.excel.worksheet.functions
Sean Timmons
external usenet poster
 
Posts: 1,722
Default Coutnif

=sumproduct(--($A$2:$A$100="X"),--($B$2:$B$1000))

"Matt" wrote:

I need help with a countif statement. I have information like the following:

A B
X 1
Y 1
X 2
X 0

I need to count how many times X in column A is greater than zero in column B.

  #4  
Old September 26th, 2008, 09:24 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Coutnif

If you're using Excel 2007:

=COUNTIFS(A1:A4,"x",B1:B4,"0")

--
Biff
Microsoft Excel MVP


"Matt" wrote in message
...
I need help with a countif statement. I have information like the
following:

A B
X 1
Y 1
X 2
X 0

I need to count how many times X in column A is greater than zero in
column B.



  #5  
Old September 27th, 2008, 05:46 AM posted to microsoft.public.excel.worksheet.functions
ShaneDevenshire
external usenet poster
 
Posts: 2,232
Default Coutnif

Hi,

And here are two old school formulas:

=SUMPRODUCT((A2:A5="X")*(B2:B50))
=SUM((A2:A5="X")*(B2:B50)) this one array entered (Shift+Ctrl+Enter)

--
Thanks,
Shane Devenshire


"Matt" wrote:

I need help with a countif statement. I have information like the following:

A B
X 1
Y 1
X 2
X 0

I need to count how many times X in column A is greater than zero in column B.

 




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 09:21 PM.


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