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  

COUNTIF for 2 columns



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2010, 10:07 PM posted to microsoft.public.excel.worksheet.functions
b1llt
external usenet poster
 
Posts: 5
Default COUNTIF for 2 columns

I'm trying to set a parameter of the following in a formula in column J:
=COUNTIF($C:$C,$B300)
That also only counts the number of times in column J where a cells (J1:J299)
value is greater than "0". ----this is where I can't figure out the how
to??

In other words, I need to set-up a formula in column J row 300 that I want
to count
the number of times that column C is equal to cell B300 only if the value in
column J's cell is greater than zero.
Thanks, Bill
  #2  
Old March 25th, 2010, 10:33 PM posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_3_]
external usenet poster
 
Posts: 489
Default COUNTIF for 2 columns

Try

=SUMPRODUCT(--($J$1:$J$2990),--($C$1:$C$299=$B300))

--

HTH

Bob

"b1llt" wrote in message
...
I'm trying to set a parameter of the following in a formula in column J:
=COUNTIF($C:$C,$B300)
That also only counts the number of times in column J where a cells
(J1:J299)
value is greater than "0". ----this is where I can't figure out the how
to??

In other words, I need to set-up a formula in column J row 300 that I want
to count
the number of times that column C is equal to cell B300 only if the value
in
column J's cell is greater than zero.
Thanks, Bill



  #3  
Old March 25th, 2010, 10:50 PM posted to microsoft.public.excel.worksheet.functions
Ziggy
external usenet poster
 
Posts: 47
Default COUNTIF for 2 columns

Try this


=COUNTIFS(C1:C299,B300,J1:J299,"0")

  #4  
Old March 25th, 2010, 11:18 PM posted to microsoft.public.excel.worksheet.functions
AGV
external usenet poster
 
Posts: 1
Default COUNTIF for 2 columns

Great suggestion Bob, also if your using excel 2007 you can use the COUNTIFS
function:

=COUNTIFS($C$1:$C$299,$B$300,$J$1:$J$299,""&0)

AGV

"Bob Phillips" wrote:

Try

=SUMPRODUCT(--($J$1:$J$2990),--($C$1:$C$299=$B300))

--

HTH

Bob

"b1llt" wrote in message
...
I'm trying to set a parameter of the following in a formula in column J:
=COUNTIF($C:$C,$B300)
That also only counts the number of times in column J where a cells
(J1:J299)
value is greater than "0". ----this is where I can't figure out the how
to??

In other words, I need to set-up a formula in column J row 300 that I want
to count
the number of times that column C is equal to cell B300 only if the value
in
column J's cell is greater than zero.
Thanks, Bill



.

  #5  
Old March 26th, 2010, 03:03 PM posted to microsoft.public.excel.worksheet.functions
Ziggy
external usenet poster
 
Posts: 47
Default COUNTIF for 2 columns

Another 2003 solution is an array formula

=SUM(($K$15:$K$38=K41)*($M$15:$M$38=1))

Set with CTRL-Shift-Enter
  #6  
Old March 26th, 2010, 09:26 PM posted to microsoft.public.excel.worksheet.functions
b1llt
external usenet poster
 
Posts: 5
Default COUNTIF for 2 columns

I should have mentioned we're still on Excel 2000.
I used these and am getting a #DIV/0! result.
Any suggestions ---thanks,
Bill

"Ziggy" wrote:

Another 2003 solution is an array formula

=SUM(($K$15:$K$38=K41)*($M$15:$M$38=1))

Set with CTRL-Shift-Enter
.

  #7  
Old March 27th, 2010, 02:18 AM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
Default COUNTIF for 2 columns

There are no divide operations in that formula, so if you're seeing a
#DIV/0! result it's because you've got a #DIV/0! in the data being used by
the formula. Tackle the problem where it's being generated.
--
David Biddulph


"b1llt" wrote in message
...
I should have mentioned we're still on Excel 2000.
I used these and am getting a #DIV/0! result.
Any suggestions ---thanks,
Bill

"Ziggy" wrote:

Another 2003 solution is an array formula

=SUM(($K$15:$K$38=K41)*($M$15:$M$38=1))

Set with CTRL-Shift-Enter
.


  #8  
Old March 29th, 2010, 06:52 PM posted to microsoft.public.excel.worksheet.functions
b1llt
external usenet poster
 
Posts: 5
Default COUNTIF for 2 columns

My bad! Your correct I did have it pulling a #DIV/O! into the data by mistake.
These all work great! Thanks everyone for all your help.
-B1llt

"David Biddulph" wrote:

There are no divide operations in that formula, so if you're seeing a
#DIV/0! result it's because you've got a #DIV/0! in the data being used by
the formula. Tackle the problem where it's being generated.
--
David Biddulph


"b1llt" wrote in message
...
I should have mentioned we're still on Excel 2000.
I used these and am getting a #DIV/0! result.
Any suggestions ---thanks,
Bill

"Ziggy" wrote:

Another 2003 solution is an array formula

=SUM(($K$15:$K$38=K41)*($M$15:$M$38=1))

Set with CTRL-Shift-Enter
.


.

 




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 01:37 AM.


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