If statement for a range of cells

D

dfuribe

Hi, I want to know if it is possible to create an IF statement that can for example give a TRUE value if all the cells in the range A1 to C50 are greater or equal to 0 and FALSE otherwise.

I have tried IF((A1:C50)>=0,TRUE,FALSE), but it does not work.

Thanks for your help,

Daniel
 
J

joeu2004

Hi, I want to know if it is possible to create an IF statement that can
for example give a TRUE value if all the cells in the range A1 to C50 are
greater or equal to 0 and FALSE otherwise.

I have tried IF((A1:C50)>=0,TRUE,FALSE), but it does not work.

Thanks for your help,

Daniel
 
J

joeu2004

[Sorry about the previous premature fat-finger send.]

Hi, I want to know if it is possible to create an IF statement
that can for example give a TRUE value if all the cells in the
range A1 to C50 are greater or equal to 0 and FALSE otherwise.
I have tried IF((A1:C50)>=0,TRUE,FALSE), but it does not work.

You might try one of the following array-entered formulas (press
ctrl+shift+Enter instead of just Enter):

=IF(AND(A1:C50>=0),TRUE)
or
=AND(A1:C50>=0)

Alternatively, try the following normally-entered formula (just press
Enter):

=IF(COUNTIF(A1:C50,">=0")=COUNT(A1:C50),TRUE)
or
=COUNTIF(A1:A50,">=0")=COUNT(A1:C50)

Caveat: COUNTIF treats numeric text differently from COUNT. And A1:C50>=0
treats all text as TRUE.
 
D

dfuribe

Thank you, it worked perfectly.

[Sorry about the previous premature fat-finger send.]



Hi, I want to know if it is possible to create an IF statement
that can for example give a TRUE value if all the cells in the
range A1 to C50 are greater or equal to 0 and FALSE otherwise.
I have tried IF((A1:C50)>=0,TRUE,FALSE), but it does not work.



You might try one of the following array-entered formulas (press

ctrl+shift+Enter instead of just Enter):



=IF(AND(A1:C50>=0),TRUE)

or

=AND(A1:C50>=0)



Alternatively, try the following normally-entered formula (just press

Enter):



=IF(COUNTIF(A1:C50,">=0")=COUNT(A1:C50),TRUE)

or

=COUNTIF(A1:A50,">=0")=COUNT(A1:C50)



Caveat: COUNTIF treats numeric text differently from COUNT. And A1:C50>=0

treats all text as TRUE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top