PC Review


Reply
Thread Tools Rate Thread

How to count multiple conditions that are "TRUE"

 
 
PSmith
Guest
Posts: n/a
 
      7th Dec 2007
Hi;

I am attempting to adapt an existing formula [=COUNTIF(AO$2:AO$2093,TRUE)]so
that it further differentiates between those that are also "TRUE" in another
range (AD2:AD2093), versus those who are "FALSE". Any suggestions would be
greatly appreciated,

Peter
 
Reply With Quote
 
 
 
 
Stephen
Guest
Posts: n/a
 
      7th Dec 2007
"PSmith" <(E-Mail Removed)> wrote in message
news:EC30D22A-8CE9-4F5B-960A-(E-Mail Removed)...
> Hi;
>
> I am attempting to adapt an existing formula
> [=COUNTIF(AO$2:AO$2093,TRUE)]so
> that it further differentiates between those that are also "TRUE" in
> another
> range (AD2:AD2093), versus those who are "FALSE". Any suggestions would be
> greatly appreciated,
>
> Peter


SUMPRODUCT is a more versatile function than SUMIF or COUNTIF.
The equivalent for your COUNTIF formula is:
=SUMPRODUCT(--(AO$2:AO$2093))
Then to add in a second condition is simple:
=SUMPRODUCT(--(AO$2:AO$2093),--(AD2:AD2093))
You can easily add further conditions if required in the future.


 
Reply With Quote
 
RagDyeR
Guest
Posts: n/a
 
      7th Dec 2007
If I understand you correctly, this should work:

=SUMPRODUCT((AD2:AD2093=TRUE)*(AO2:AO2093=TRUE))


--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

"PSmith" <(E-Mail Removed)> wrote in message
news:EC30D22A-8CE9-4F5B-960A-(E-Mail Removed)...
Hi;

I am attempting to adapt an existing formula [=COUNTIF(AO$2:AO$2093,TRUE)]so
that it further differentiates between those that are also "TRUE" in another
range (AD2:AD2093), versus those who are "FALSE". Any suggestions would be
greatly appreciated,

Peter


 
Reply With Quote
 
RagDyeR
Guest
Posts: n/a
 
      7th Dec 2007
The caveat with your formula is that it works with logicals only.

Any text in the referenced columns will cause an error.

However, that may *not* be a problem, depending on the OP's data.

Just an FYI for the OP.
--

Regards,

RD
-----------------------------------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit !
-----------------------------------------------------------------------------------------------

"Stephen" <none> wrote in message
news:eh$(E-Mail Removed)...
"PSmith" <(E-Mail Removed)> wrote in message
news:EC30D22A-8CE9-4F5B-960A-(E-Mail Removed)...
> Hi;
>
> I am attempting to adapt an existing formula
> [=COUNTIF(AO$2:AO$2093,TRUE)]so
> that it further differentiates between those that are also "TRUE" in
> another
> range (AD2:AD2093), versus those who are "FALSE". Any suggestions would be
> greatly appreciated,
>
> Peter


SUMPRODUCT is a more versatile function than SUMIF or COUNTIF.
The equivalent for your COUNTIF formula is:
=SUMPRODUCT(--(AO$2:AO$2093))
Then to add in a second condition is simple:
=SUMPRODUCT(--(AO$2:AO$2093),--(AD2:AD2093))
You can easily add further conditions if required in the future.



 
Reply With Quote
 
PSmith
Guest
Posts: n/a
 
      7th Dec 2007
Just a question about your solution: which part of the formula specifies the
"TRUE" aspect?

"Stephen" wrote:

> "PSmith" <(E-Mail Removed)> wrote in message
> news:EC30D22A-8CE9-4F5B-960A-(E-Mail Removed)...
> > Hi;
> >
> > I am attempting to adapt an existing formula
> > [=COUNTIF(AO$2:AO$2093,TRUE)]so
> > that it further differentiates between those that are also "TRUE" in
> > another
> > range (AD2:AD2093), versus those who are "FALSE". Any suggestions would be
> > greatly appreciated,
> >
> > Peter

>
> SUMPRODUCT is a more versatile function than SUMIF or COUNTIF.
> The equivalent for your COUNTIF formula is:
> =SUMPRODUCT(--(AO$2:AO$2093))
> Then to add in a second condition is simple:
> =SUMPRODUCT(--(AO$2:AO$2093),--(AD2:AD2093))
> You can easily add further conditions if required in the future.
>
>
>

 
Reply With Quote
 
PSmith
Guest
Posts: n/a
 
      7th Dec 2007
Thanks RagDyer; I had used quotation marks around the words TRUE, and when
that didn't work, I tried (,TRUE). Thanks very much for your help, it is very
much appreciated.

"RagDyeR" wrote:

> If I understand you correctly, this should work:
>
> =SUMPRODUCT((AD2:AD2093=TRUE)*(AO2:AO2093=TRUE))
>
>
> --
>
> HTH,
>
> RD
> =====================================================
> Please keep all correspondence within the Group, so all may benefit!
> =====================================================
>
> "PSmith" <(E-Mail Removed)> wrote in message
> news:EC30D22A-8CE9-4F5B-960A-(E-Mail Removed)...
> Hi;
>
> I am attempting to adapt an existing formula [=COUNTIF(AO$2:AO$2093,TRUE)]so
> that it further differentiates between those that are also "TRUE" in another
> range (AD2:AD2093), versus those who are "FALSE". Any suggestions would be
> greatly appreciated,
>
> Peter
>
>
>

 
Reply With Quote
 
RagDyer
Guest
Posts: n/a
 
      7th Dec 2007
You're very welcome, and thank you for the feed back.

As to your question to Stephen about his formula:
If the *only* values in both your columns are TRUE and/or FALSE, it will
work.

If there's a possibility that those columns might contain numbers, then you
might have incorrect results returned (paired rows will multiply each
other).
If there's text in either column, then you'll get a #Value error.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"PSmith" <(E-Mail Removed)> wrote in message
news:268BB171-8DC1-4BCD-8529-(E-Mail Removed)...
> Thanks RagDyer; I had used quotation marks around the words TRUE, and when
> that didn't work, I tried (,TRUE). Thanks very much for your help, it is
> very
> much appreciated.
>
> "RagDyeR" wrote:
>
>> If I understand you correctly, this should work:
>>
>> =SUMPRODUCT((AD2:AD2093=TRUE)*(AO2:AO2093=TRUE))
>>
>>
>> --
>>
>> HTH,
>>
>> RD
>> =====================================================
>> Please keep all correspondence within the Group, so all may benefit!
>> =====================================================
>>
>> "PSmith" <(E-Mail Removed)> wrote in message
>> news:EC30D22A-8CE9-4F5B-960A-(E-Mail Removed)...
>> Hi;
>>
>> I am attempting to adapt an existing formula
>> [=COUNTIF(AO$2:AO$2093,TRUE)]so
>> that it further differentiates between those that are also "TRUE" in
>> another
>> range (AD2:AD2093), versus those who are "FALSE". Any suggestions would
>> be
>> greatly appreciated,
>>
>> Peter
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
change "true" and "false" to "availble" and "out of stock" =?Utf-8?B?aW50aGVzdGFuZHM=?= Microsoft Excel Worksheet Functions 2 19th Jul 2007 07:05 PM
conditions and count occurrences of "not blank" =?Utf-8?B?bGVhcm5pbmc=?= Microsoft Excel Misc 4 16th Nov 2006 12:05 AM
How to check if one of the conditions returns "true"? =?Utf-8?B?SXNpdG8=?= Microsoft Excel Programming 4 6th Sep 2006 12:25 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB Microsoft Excel New Users 7 13th May 2006 10:02 PM
Count using 2 conditions, one of which being a "less than or equal to" - URGENT SamGB Microsoft Excel Misc 2 15th Feb 2006 10:35 AM


Features
 

Advertising
 

Newsgroups
 


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