Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default count values in one column per value in another

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!
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default count values in one column per value in another

With Prouduction line in ColA and Bag/Box in Col B

Try the below formula

=SUMPRODUCT(--(A1:A100="A"),--(B1:B100="Bag"))

If this post helps click Yes
---------------
Jacob Skaria


"mooresk257" wrote:

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!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default count values in one column per value in another

Hi,
I assume you have your numbers in column A and if it is a bag or box in
column B, in c1 you enter the product to be counted and in D1 you want the
result so in D1 enter

=SUMPRODUCT((B1:B5=C1)*A1:A5)

"mooresk257" wrote:

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!

  #5   Report Post  
Posted to microsoft.public.excel.misc
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!





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default count values in one column per value in another

This worked - but what does the "--" i nthe formula mean to Excel? I've never
seen this before, and obviously the formula doesn't work without the two
dashes.

Thanks!

"Jacob Skaria" wrote:

With Prouduction line in ColA and Bag/Box in Col B

Try the below formula

=SUMPRODUCT(--(A1:A100="A"),--(B1:B100="Bag"))

If this post helps click Yes
---------------
Jacob Skaria


"mooresk257" wrote:

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!

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default count values in one column per value in another

Hi,
in C1 you enter Bag and in C2 A, you can change it to count other lines or
boxes so in D2 enter

=SUMPRODUCT((A2:A5000=C2)*(B2:B5000=C1))

"mooresk257" wrote:

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!



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default count values in one column per value in another

You can also try
=SUMPRODUCT((A1:A100="A")*(B1:B100="Bag"))

-- converts boolean values to 1 and 0. Check out
http://mcgimpsey.com/excel/formulae/doubleneg.html


If this post helps click Yes
---------------
Jacob Skaria


"mooresk257" wrote:

This worked - but what does the "--" i nthe formula mean to Excel? I've never
seen this before, and obviously the formula doesn't work without the two
dashes.

Thanks!

"Jacob Skaria" wrote:

With Prouduction line in ColA and Bag/Box in Col B

Try the below formula

=SUMPRODUCT(--(A1:A100="A"),--(B1:B100="Bag"))

If this post helps click Yes
---------------
Jacob Skaria


"mooresk257" wrote:

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!

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default count values in one column per value in another

Thanks - that make perfect sense!

"Jacob Skaria" wrote:

You can also try
=SUMPRODUCT((A1:A100="A")*(B1:B100="Bag"))

-- converts boolean values to 1 and 0. Check out
http://mcgimpsey.com/excel/formulae/doubleneg.html


If this post helps click Yes
---------------
Jacob Skaria


"mooresk257" wrote:

This worked - but what does the "--" i nthe formula mean to Excel? I've never
seen this before, and obviously the formula doesn't work without the two
dashes.

Thanks!

"Jacob Skaria" wrote:

With Prouduction line in ColA and Bag/Box in Col B

Try the below formula

=SUMPRODUCT(--(A1:A100="A"),--(B1:B100="Bag"))

If this post helps click Yes
---------------
Jacob Skaria


"mooresk257" wrote:

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!

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
Count Unique Values in 1 Column based on Date Range in another Column Brian Excel Worksheet Functions 14 May 17th 09 02:58 PM
Count cells w/values in column if the data in column a matches cri mdcgpw Excel Worksheet Functions 4 January 12th 09 11:55 PM
Count entries in one column based on values in another column Kurt Excel Worksheet Functions 7 January 10th 07 09:29 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
Can I count values in column 1 if criteria in column 2 are met confounded office user Excel Worksheet Functions 2 November 9th 04 12:02 PM


All times are GMT +1. The time now is 08:56 PM.

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

About Us

"It's about Microsoft Excel"