Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JRJ JRJ is offline
external usenet poster
 
Posts: 6
Default Evaluating mulitple criteria with COUNTIF

Can anyone help me with a formula to count the number of occurrences a color
appears for a particular location?
Sample Data:

Location Color
2242 ALMOND
2247 ALMOND
2247 WHITE
2247 WHITE
2247 BLACK
2242 BLACK
2242 WHITE
2242 ALMOND
2242 BLACK
2242 ALMOND

Example Result:

Location ALMOND WHITE BLACK
2242 3 1 2
2247 1 2 1

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default Evaluating mulitple criteria with COUNTIF

=sumproduct(--a2:a22=2242),--(b2:b22="almond")
or
=sumproduct((a2:a22=2242)*(b2:b22="almond"))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JRJ" wrote in message
...
Can anyone help me with a formula to count the number of occurrences a
color
appears for a particular location?
Sample Data:

Location Color
2242 ALMOND
2247 ALMOND
2247 WHITE
2247 WHITE
2247 BLACK
2242 BLACK
2242 WHITE
2242 ALMOND
2242 BLACK
2242 ALMOND

Example Result:

Location ALMOND WHITE BLACK
2242 3 1 2
2247 1 2 1

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default Evaluating mulitple criteria with COUNTIF

You can do this easily with a pivot table. Put Location as a Row field, Color
as a Column field, and Color as the Data field. By default, it will count the
number of occurences.

You could alternatively use SUMPRODUCT formulas like this:
=SUMPRODUCT(--(A2:A11="2242"),--(B2:B11="Almond"))

Hope this helps,

Hutch

"JRJ" wrote:

Can anyone help me with a formula to count the number of occurrences a color
appears for a particular location?
Sample Data:

Location Color
2242 ALMOND
2247 ALMOND
2247 WHITE
2247 WHITE
2247 BLACK
2242 BLACK
2242 WHITE
2242 ALMOND
2242 BLACK
2242 ALMOND

Example Result:

Location ALMOND WHITE BLACK
2242 3 1 2
2247 1 2 1

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Evaluating mulitple criteria with COUNTIF

Would you consider using a Pivot Table?

From the Excel Main Menu: <Data<Pivot Table
Use: Excel..Click [Next]
Select your data..Click [Next]
Click the [Layout] button

ROW: Drag the LOCATION field here
COLUMN: Drag the COLOR field here
DATA: Drag the COLOR field here, too.
(It will list as Count of COLOR)
Click [OK]
Select where you want the Pivot Table.Click [Finish].

That will list LOCATION down the left
COLOR across the top and
the count for each LOCATION/COLOR combination

To refresh the Pivot Table, just right click it and select Refresh Data

Pivot Table Links:
http://www.nickhodge.co.uk/gui/datam...ablereport.htm
http://www.contextures.com/tiptech.html

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"JRJ" wrote in message
...
Can anyone help me with a formula to count the number of occurrences a
color
appears for a particular location?
Sample Data:

Location Color
2242 ALMOND
2247 ALMOND
2247 WHITE
2247 WHITE
2247 BLACK
2242 BLACK
2242 WHITE
2242 ALMOND
2242 BLACK
2242 ALMOND

Example Result:

Location ALMOND WHITE BLACK
2242 3 1 2
2247 1 2 1

Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JRJ JRJ is offline
external usenet poster
 
Posts: 6
Default Evaluating mulitple criteria with COUNTIF

You guys gave me a couple of different options that all work.
Thanks!

"Ron Coderre" wrote:

Would you consider using a Pivot Table?

From the Excel Main Menu: <Data<Pivot Table
Use: Excel..Click [Next]
Select your data..Click [Next]
Click the [Layout] button

ROW: Drag the LOCATION field here
COLUMN: Drag the COLOR field here
DATA: Drag the COLOR field here, too.
(It will list as Count of COLOR)
Click [OK]
Select where you want the Pivot Table.Click [Finish].

That will list LOCATION down the left
COLOR across the top and
the count for each LOCATION/COLOR combination

To refresh the Pivot Table, just right click it and select Refresh Data

Pivot Table Links:
http://www.nickhodge.co.uk/gui/datam...ablereport.htm
http://www.contextures.com/tiptech.html

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"JRJ" wrote in message
...
Can anyone help me with a formula to count the number of occurrences a
color
appears for a particular location?
Sample Data:

Location Color
2242 ALMOND
2247 ALMOND
2247 WHITE
2247 WHITE
2247 BLACK
2242 BLACK
2242 WHITE
2242 ALMOND
2242 BLACK
2242 ALMOND

Example Result:

Location ALMOND WHITE BLACK
2242 3 1 2
2247 1 2 1

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
COUNTIF Function with mulitple criteria? Corey Excel Worksheet Functions 6 January 28th 07 02:02 PM
count unique with mulitple criteria ellebelle Excel Worksheet Functions 22 October 13th 06 11:26 PM
LookUp with Mulitple Criteria TimR Excel Discussion (Misc queries) 4 July 13th 06 12:22 AM
mulitple criteria imjustme Excel Discussion (Misc queries) 9 September 2nd 05 02:07 AM
returning a value based on mulitple criteria Brad Excel Worksheet Functions 6 December 31st 04 08:14 AM


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