ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to count cells which contain a formula that returns TRUE (https://www.excelbanter.com/excel-worksheet-functions/239523-how-count-cells-contain-formula-returns-true.html)

Art

How to count cells which contain a formula that returns TRUE
 
The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells

Gary''s Student

How to count cells which contain a formula that returns TRUE
 
In A1 thru A7 enter:
=1=1
In A8 thru A10 enter:
=1=2

We see in A1 thru A10:
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE

in another cell enter:
=COUNTIF(A1:A10,TRUE)
which correctly displays 7
--
Gary''s Student - gsnu200860


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


Jacob Skaria

How to count cells which contain a formula that returns TRUE
 
MAke sure your formulas which return TRUE returns the boolean TRUE and not a
text (within double quotes) like

To count on formulas like this one you need to use COUNTIF(a:a,"true")
=IF(A1=0,"true","false")


To count on formulas which return boolean you can try COUNTIF(a:a,TRUE)
=IF(A1=0,TRUE,FALSE)


If this post helps click Yes
---------------
Jacob Skaria


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


David Biddulph[_2_]

How to count cells which contain a formula that returns TRUE
 
Are you sure that your formula is returning the boolean value TRUE and not
the text string "TRUE" ?
--
David Biddulph

"Art" wrote in message
...
The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning
TRUE
it doesn't count.It count only if I simply type TRUE in the cells




Art

How to count cells which contain a formula that returns TRUE
 
It works in your example, but not in my particular case :(
I'm using:
=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")
this returns TRUE or nothing.
I just want simply count the cells returning TRUE.
Grrrr
Thanks,

"Gary''s Student" wrote:

In A1 thru A7 enter:
=1=1
In A8 thru A10 enter:
=1=2

We see in A1 thru A10:
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE

in another cell enter:
=COUNTIF(A1:A10,TRUE)
which correctly displays 7
--
Gary''s Student - gsnu200860


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


Ron Rosenfeld

How to count cells which contain a formula that returns TRUE
 
On Wed, 12 Aug 2009 03:26:01 -0700, Art wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


Post your formula. There is likely some error in how you are trying to do
this, as I cannot reproduce your problem here.
--ron

Art

How to count cells which contain a formula that returns TRUE
 
I've tried both formulas:
=IF(A1:A10,TRUE)
and
=IF(A1:A10,"true")
Both give 0 in my case.
Thanks,

"Jacob Skaria" wrote:

MAke sure your formulas which return TRUE returns the boolean TRUE and not a
text (within double quotes) like

To count on formulas like this one you need to use COUNTIF(a:a,"true")
=IF(A1=0,"true","false")


To count on formulas which return boolean you can try COUNTIF(a:a,TRUE)
=IF(A1=0,TRUE,FALSE)


If this post helps click Yes
---------------
Jacob Skaria


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


Art

How to count cells which contain a formula that returns TRUE
 
=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")
this returns TRUE or nothing.
I just want simply count the cells returning TRUE.

I've tried both formulas:
=COUNTIF (A1:A10,TRUE)
or
=COUNTIF(A1:A10,"TRUE")
Both give 0 in my case.
Thanks,

"Ron Rosenfeld" wrote:

On Wed, 12 Aug 2009 03:26:01 -0700, Art wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


Post your formula. There is likely some error in how you are trying to do
this, as I cannot reproduce your problem here.
--ron


David Biddulph[_2_]

How to count cells which contain a formula that returns TRUE
 
Your formula is producing the text string "TRUE", not the logical value
TRYE. Get rid of the quote marks.
--
David Biddulph

"Art" wrote in message
...
It works in your example, but not in my particular case :(
I'm using:
=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")
this returns TRUE or nothing.
I just want simply count the cells returning TRUE.
Grrrr
Thanks,

"Gary''s Student" wrote:

In A1 thru A7 enter:
=1=1
In A8 thru A10 enter:
=1=2

We see in A1 thru A10:
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE

in another cell enter:
=COUNTIF(A1:A10,TRUE)
which correctly displays 7
--
Gary''s Student - gsnu200860


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning
TRUE
it doesn't count.It count only if I simply type TRUE in the cells




David Biddulph[_2_]

How to count cells which contain a formula that returns TRUE
 
Are you sure that your COUNTIF formulae work, Jacob? For me, with Excel
2003, it seems to treat both as looking for the boolean, not the text
string.
--
David Biddulph

"Jacob Skaria" wrote in message
...
MAke sure your formulas which return TRUE returns the boolean TRUE and not
a
text (within double quotes) like

To count on formulas like this one you need to use COUNTIF(a:a,"true")
=IF(A1=0,"true","false")


To count on formulas which return boolean you can try COUNTIF(a:a,TRUE)
=IF(A1=0,TRUE,FALSE)


If this post helps click Yes
---------------
Jacob Skaria


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning
TRUE
it doesn't count.It count only if I simply type TRUE in the cells




Jacob Skaria

How to count cells which contain a formula that returns TRUE
 
Oops...you are right we cannot and will have to use
=SUMPRODUCT(--(A1:A10="TRUE"))

If this post helps click Yes
---------------
Jacob Skaria


"David Biddulph" wrote:

Are you sure that your COUNTIF formulae work, Jacob? For me, with Excel
2003, it seems to treat both as looking for the boolean, not the text
string.
--
David Biddulph

"Jacob Skaria" wrote in message
...
MAke sure your formulas which return TRUE returns the boolean TRUE and not
a
text (within double quotes) like

To count on formulas like this one you need to use COUNTIF(a:a,"true")
=IF(A1=0,"true","false")


To count on formulas which return boolean you can try COUNTIF(a:a,TRUE)
=IF(A1=0,TRUE,FALSE)


If this post helps click Yes
---------------
Jacob Skaria


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning
TRUE
it doesn't count.It count only if I simply type TRUE in the cells





Art

How to count cells which contain a formula that returns TRUE
 
I've got it working,but ...
The formula returns text string,so I changed it to e.g Yes
=IF(AND(C181=1,G181=0,J181=1), "Yes", "")

And now using
=COUNTIF (A1:A10,Yes)
it works!

But as I mentioned before with the formula:
=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")

and
formulas:
=COUNTIF (A1:A10,TRUE)
or
=COUNTIF(A1:A10,"TRUE")
Both give 0 in my case.

Thank you for your quick replies.
Art


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


Jacob Skaria

How to count cells which contain a formula that returns TRUE
 
Try the below array formula which should count both text "TRUE" and boolean
TRUE

=SUM(IF(IF(F1:F20<"",F1:F20&"A")="TRUEA",1,0))

If this post helps click Yes
---------------
Jacob Skaria


"Art" wrote:

I've got it working,but ...
The formula returns text string,so I changed it to e.g Yes
=IF(AND(C181=1,G181=0,J181=1), "Yes", "")

And now using
=COUNTIF (A1:A10,Yes)
it works!

But as I mentioned before with the formula:
=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")

and
formulas:
=COUNTIF (A1:A10,TRUE)
or
=COUNTIF(A1:A10,"TRUE")
Both give 0 in my case.

Thank you for your quick replies.
Art


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning TRUE
it doesn't count.It count only if I simply type TRUE in the cells


T. Valko

How to count cells which contain a formula that returns TRUE
 
it seems to treat both as looking for the boolean, not the text string.

To count TEXT "true":

=COUNTIF(A1:A10,"*true")


--
Biff
Microsoft Excel MVP


"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
Are you sure that your COUNTIF formulae work, Jacob? For me, with Excel
2003, it seems to treat both as looking for the boolean, not the text
string.
--
David Biddulph

"Jacob Skaria" wrote in message
...
MAke sure your formulas which return TRUE returns the boolean TRUE and
not a
text (within double quotes) like

To count on formulas like this one you need to use COUNTIF(a:a,"true")
=IF(A1=0,"true","false")


To count on formulas which return boolean you can try COUNTIF(a:a,TRUE)
=IF(A1=0,TRUE,FALSE)


If this post helps click Yes
---------------
Jacob Skaria


"Art" wrote:

The question in princilpe refers to any cell that contain formula.I\ve
noticed that if I use COUNTIF on cells that contains formula returning
TRUE
it doesn't count.It count only if I simply type TRUE in the cells






Ron Rosenfeld

How to count cells which contain a formula that returns TRUE
 
On Wed, 12 Aug 2009 04:16:02 -0700, Art wrote:

=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")
this returns TRUE or nothing.
I just want simply count the cells returning TRUE.

I've tried both formulas:
=COUNTIF (A1:A10,TRUE)
or
=COUNTIF(A1:A10,"TRUE")
Both give 0 in my case.
Thanks,


This is a fascinating finding.

One simple way around it is to change your IF formula to return the Boolean:

=IF(AND(C181=1,G181=0,J181=1), TRUE, "")

COUNTIF will then work as designed.

I think what may be happening is that COUNTIF is changing what should be the
text string "TRUE" into the Boolean, because both of these formulas seem to
work, so long as you change your IF formula to return a BOOLEAN TRUE:

=COUNTIF(A1:A10,"TRUE")
=COUNTIF(A1:A10,TRUE)

--ron

Ron Rosenfeld

How to count cells which contain a formula that returns TRUE
 
On Wed, 12 Aug 2009 04:16:02 -0700, Art wrote:

=IF(AND(C181=1,G181=0,J181=1), "TRUE", "")
this returns TRUE or nothing.
I just want simply count the cells returning TRUE.

I've tried both formulas:
=COUNTIF (A1:A10,TRUE)
or
=COUNTIF(A1:A10,"TRUE")
Both give 0 in my case.
Thanks,



And, of course, you could also change the COUNTIF formula:

=COUNTIF(A1:A10,"*TRUE")
--ron


All times are GMT +1. The time now is 02:50 PM.

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