Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
EJ EJ is offline
external usenet poster
 
Posts: 20
Default COUNTIF with criteria in 2 columns

I have the following...
CUSTOMER CODE
Jones A
Jones B
Jones B
Smith A
Smith C
Smith A
Jones B
Davis B

I need to be able to count how many cells ion the CODE column contain 'B',
but only if the CUSTOMER is 'Jones'

I cannot sort, or use named ranges in this case...

I'm sure its really straightforward, but I just can't work it out!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default COUNTIF with criteria in 2 columns

=SUMPRODUCT(--(A2:A20="Jones"),--(B2:B20="B"))

SP cannot use whole columns, you have to define the range to use.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"EJ" wrote in message
...
I have the following...
CUSTOMER CODE
Jones A
Jones B
Jones B
Smith A
Smith C
Smith A
Jones B
Davis B

I need to be able to count how many cells ion the CODE column contain 'B',
but only if the CUSTOMER is 'Jones'

I cannot sort, or use named ranges in this case...

I'm sure its really straightforward, but I just can't work it out!



  #3   Report Post  
Posted to microsoft.public.excel.misc
EJ EJ is offline
external usenet poster
 
Posts: 20
Default COUNTIF with criteria in 2 columns

Ignore me.... I've worked it out with SUMPRODUCT!

What I do need to know is a similar thing.

I've been using =SUMIF(C$5:C$317,"0.5") - column C can contain any value
between 1 and 50 and I need the sum, but I only need it to use this if cells
in column B meet a particular criteria, as per my previous question.


Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default COUNTIF with criteria in 2 columns

=SUMIF(B$5:B$317,"Jones",C$5:C$317)

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"EJ" wrote in message
...
Ignore me.... I've worked it out with SUMPRODUCT!

What I do need to know is a similar thing.

I've been using =SUMIF(C$5:C$317,"0.5") - column C can contain any value
between 1 and 50 and I need the sum, but I only need it to use this if
cells
in column B meet a particular criteria, as per my previous question.


Thanks



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
sum items in a column based on criteria located in other columns Kurt Excel Discussion (Misc queries) 1 August 2nd 06 05:12 PM
countif = < AND value in adjacent columns match criteria crafty_girl Excel Worksheet Functions 3 April 27th 06 08:40 PM
Excel COUNTIF Function - a range as criteria ? joes Excel Worksheet Functions 2 March 6th 06 01:13 PM
countif criteria only one word of few doesn't work dcd123 Excel Worksheet Functions 3 August 22nd 05 01:46 PM
want to count in two columns; countif (colA=x AND colB=y)? Heather Murch Excel Worksheet Functions 1 February 17th 05 03:47 PM


All times are GMT +1. The time now is 01:37 AM.

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"