ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Countif with two terms (https://www.excelbanter.com/excel-discussion-misc-queries/188167-countif-two-terms.html)

FreddieP

Countif with two terms
 
Hi, I would like to count the number of the letter F in column A if column
B=x and column C=y (both terms must be fulfilled.)

I tried countif with no success.

what formula should I use?

Don Guillett

Countif with two terms
 

=sumproduct((a2:a22="f")*(b2:b22="x"))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"FreddieP" wrote in message
...
Hi, I would like to count the number of the letter F in column A if column
B=x and column C=y (both terms must be fulfilled.)

I tried countif with no success.

what formula should I use?



Ron Coderre

Countif with two terms
 
Try one of these:

=SUMPRODUCT(--(A2:A20="F"),--(B2:B20="X"),--(C2:C20="Y"))
or...
=SUMPRODUCT(--(A2:A20="F")*(B2:B20="X")*(C2:C20="Y"))

Alternatively, if "X" and "Y" refer to values in other cells,
perhaps something like this:
=SUMPRODUCT(--(A2:A20="F"),--(B2:B20=D1),--(C2:C20=E1))

Adjust range references to suit your situation.

Does that help?
Post back if you have more questions.

Regards,

Ron
Microsoft MVP - Excel

"FreddieP" wrote in message
...
Hi, I would like to count the number of the letter F in column A if column
B=x and column C=y (both terms must be fulfilled.)

I tried countif with no success.

what formula should I use?



David Biddulph[_2_]

Countif with two terms
 
=SUMPRODUCT(--(A1:A100="F"),--(B1:B100="x"),--(C1:C100="y"))
--
David Biddulph

"FreddieP" wrote in message
...
Hi, I would like to count the number of the letter F in column A if column
B=x and column C=y (both terms must be fulfilled.)

I tried countif with no success.

what formula should I use?





All times are GMT +1. The time now is 12:09 AM.

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