#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 516
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
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.

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



All times are GMT +1. The time now is 11:00 PM.

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

About Us

"It's about Microsoft Excel"