I have this table and I would like to create a formula which would count values based on true conditions from column A
and column C
.
Example: If in column A
value is M (male), and in column C
is YES, then it would count.
could anyone help me with this formula?
You can use the COUNTIFS function in Excel to count cells in a single range with a single condition as well as in multiple ranges with multiple conditions. If the latter, only those cells that meet all of the specified conditions are counted.
If there are more than two criteria that you want to count in one column, just use =COUNTIF(range1, criteria1) + COUNTIF(range2, criteria2) + COUNTIF(range3, criteria3)+…
The COUNTIF function allows you to construct a small IF formula that carries out plenty of logical expressions. Combining the IF and COUNTIF functions also let you have more than 254 logical expressions and the effort to type the formula is minimal.
Add the sheet name infront of the cell, e.g.:
=COUNTIFS(stock!A:A,"M",stock!C:C,"Yes")
Assumes the sheet name is "stock"
If youR data was in A1:C100
then:
Excel - all versions
=SUMPRODUCT(--(A1:A100="M"),--(C1:C100="Yes"))
Excel - 2007 onwards
=COUNTIFS(A1:A100,"M",C1:C100,"Yes")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With