Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using count for an AND statement
Hi,
I tried to make a formula that count if two statements are true. For example, =COUNTIF(M!E2:E37,"P") This formula give me the correct number that is 7. =COUNTIF(M!L2:L37,"Y") This formula give me the correct number that is 25. Then, I tried to combined this 2 formulas for using a conditional statement AND, because I want that the formula count when this 2 statements are true. =AND((COUNTIF(M!E2:E37, "P")), (COUNTIF(M!L2:L37, "Y"))) Result: True Then, I tried to make the count if this condition are True, but the count give a wrong number. The formula that I tried is =COUNT(AND((COUNTIF(M!E2:E37, "P")), (COUNTIF(M!L2:L37, "Y")))) Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using count for an AND statement
=sumproduct(--(M!E2:E37="P"),--(M!L2:L37="Y"))
-- Regards, Tom Ogilvy "anamarie30" wrote: Hi, I tried to make a formula that count if two statements are true. For example, =COUNTIF(M!E2:E37,"P") This formula give me the correct number that is 7. =COUNTIF(M!L2:L37,"Y") This formula give me the correct number that is 25. Then, I tried to combined this 2 formulas for using a conditional statement AND, because I want that the formula count when this 2 statements are true. =AND((COUNTIF(M!E2:E37, "P")), (COUNTIF(M!L2:L37, "Y"))) Result: True Then, I tried to make the count if this condition are True, but the count give a wrong number. The formula that I tried is =COUNT(AND((COUNTIF(M!E2:E37, "P")), (COUNTIF(M!L2:L37, "Y")))) Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
COUNT A YES STATEMENT AGAINST A NAME | Excel Discussion (Misc queries) | |||
Count if statement | Excel Worksheet Functions | |||
If & Count Statement | Excel Worksheet Functions | |||
Help with Count IF Statement | Excel Discussion (Misc queries) | |||
count if statement | Excel Discussion (Misc queries) |