Excel function to countif a criteria is matced within to columns

  • Thread starter =countif(data!A:A,001,andif (data!B:B,
  • Start date
C

=countif(data!A:A,001,andif (data!B:B,

Hello, I am looking for a the proper function in excel that would allow me to
count if a criteria is matched in column "A" and if another criteria is
matched in column "B".
 
B

Bob Phillips

You are looking at SUMPRODUCT, but not on whole columns, just part

=SUMPRODUCT(--(A1:A100="val1"),--(B1:B1000=123))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"=countif(data!A:A, 001 ,andif (data!B:B," <=countif(data!A:A,"001",andif
(data!B:B,@discussions.microsoft.com> wrote in message
news:[email protected]...
 
C

=countif(data!A:A,001,andif (data!B:B,

Bob,

Thanks for the quick response, but the formula did not work. What I would
like for the formula to do is count the number of occurences only if the
criteria defined in column "a" and column "b" are met. I tried the formula
you provided and it gave me #value!, it would not populate the total of
occurences. I know how to have it count if I will looking for data within
one column, I just can make it look different data within two column. The
formula I was using for one column was =countif(Data!A:A,"002asm")

Any help would be greatly appreciated!
 
C

=countif(data!A:A,001,andif (data!B:B,

Thanks for the quick response, but the formula
=SUMPRODUCT(--(A1:A100="val1"),--(B1:B1000=123))

did not work. What I would like for the formula to do is count the number
of occurences only if the criteria defined in column "a" and column "b" are
met. I tried the formula you provided and it gave me #value!, it would not
populate the total of occurences. I know how to have it count if I will
looking for data within one column, I just can make it look different data
within two column. The formula I was using for one column was
=countif(Data!A:A,"002asm")
 
B

Bob Phillips

You need to substitute "val1" and 123 with your values

--

HTH

RP
(remove nothere from the email address if mailing direct)


"=countif(data!A:A, 001 ,andif (data!B:B,"
 
Top