View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
mooresk257 mooresk257 is offline
external usenet poster
 
Posts: 50
Default count values in one column per value in another

Well that's because I'm not sure what formula to use. Let me try and explain
it this way:

I have two columns:

Line Packaging
A BAG
A BOX
A BAG
B BOX
B BOX
B BAG
B BOX
C BAG
C BOX
C BAG

I need help with a formula that will count the number of "BAG" for line "A"
- which is 2.

I tried using COUNTIF as an array formula but that doesn't work - it counts
all "BAG" for the array.

{=IF(A2:A11="A",COUNTIF(B2:B11,"BAG"),0)} which gives an answer of 5.

So what I need is a COUNTIF(array1 = "A" and array2 = "BAG")



"Don Guillett" wrote:

You did NOT post your formula for comments
=countif(a2:a22,"bag")


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"mooresk257" wrote in message
...
This seems like it should be simple enough, but for some reason it's
eluding
me today.

I want to "countif" values in one column based on a specific value in
another.

For example, I have a production line A, B, or C that makes a product that
is in either a bag or a box.

So, I want to count the number of products on line A that are in a bag.

Thanks!