Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNT A YES STATEMENT AGAINST A NAME Dave Excel Discussion (Misc queries) 4 July 9th 09 02:14 PM
Count if statement frankb Excel Worksheet Functions 3 March 11th 09 12:28 PM
If & Count Statement Chris Excel Worksheet Functions 8 August 9th 08 11:21 PM
Help with Count IF Statement [email protected] Excel Discussion (Misc queries) 3 November 3rd 05 09:02 AM
count if statement NYDIA Excel Discussion (Misc queries) 4 February 1st 05 09:30 PM


All times are GMT +1. The time now is 06:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"