ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help with IF - THEN (https://www.excelbanter.com/excel-discussion-misc-queries/248372-help-if-then.html)

cindyt

Help with IF - THEN
 
Hi - need formula that will count in one column based on condition in another
column.

For Instance - if column A has "Blue" , I want to check column B and if it
has "Y" I want to count the number of "Y"'s (associated with Blue)

Thanks for your help in advance. ct

Bob Phillips[_3_]

Help with IF - THEN
 
=SUMPRODUCT(--(A2:A200="Blue"),--(B2:B200="Y"))

--
__________________________________
HTH

Bob

"Cindyt" wrote in message
...
Hi - need formula that will count in one column based on condition in
another
column.

For Instance - if column A has "Blue" , I want to check column B and if it
has "Y" I want to count the number of "Y"'s (associated with Blue)

Thanks for your help in advance. ct




Jacob Skaria

Help with IF - THEN
 
When you have multiple criteria use SUMPRODUCT()

=SUMPRODUCT((A1:A10=criteria1)*(B1:B10=criteria2))
=SUMPRODUCT((A1:A10=F1)*(B1:B10=F2))

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


"Cindyt" wrote:

Hi - need formula that will count in one column based on condition in another
column.

For Instance - if column A has "Blue" , I want to check column B and if it
has "Y" I want to count the number of "Y"'s (associated with Blue)

Thanks for your help in advance. ct


Mike H

Help with IF - THEN
 
Hi,

Maybe this

=SUMPRODUCT((A1:A19="Blue")*(B1:B19="Y"))

Mike

"Cindyt" wrote:

Hi - need formula that will count in one column based on condition in another
column.

For Instance - if column A has "Blue" , I want to check column B and if it
has "Y" I want to count the number of "Y"'s (associated with Blue)

Thanks for your help in advance. ct


Sean Timmons

Help with IF - THEN
 
Ahh, the ever popular SUMPRODUCT!

=SUMPRODUCT((A2:A5000="Blue")*(B2:B5000="Y"))

Please note, cannot use entire column (A:A), and both ranges must match
(2-5000, or 2 - 100, or whatever)

"Cindyt" wrote:

Hi - need formula that will count in one column based on condition in another
column.

For Instance - if column A has "Blue" , I want to check column B and if it
has "Y" I want to count the number of "Y"'s (associated with Blue)

Thanks for your help in advance. ct


T. Valko

Help with IF - THEN
 
If you're using Excel 2007:

=COUNTIFS(A1:A100,"Blue",B1:B100,"Y")

Better to use cells to hold the criteria:

D1 = Blue
E1 = Y

=COUNTIFS(A1:A100,D1,B1:B100,E1)

--
Biff
Microsoft Excel MVP


"Cindyt" wrote in message
...
Hi - need formula that will count in one column based on condition in
another
column.

For Instance - if column A has "Blue" , I want to check column B and if it
has "Y" I want to count the number of "Y"'s (associated with Blue)

Thanks for your help in advance. ct





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com