Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If statement for a range of cells

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default If statement for a range of cells

wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default If statement for a range of cells

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

wrote:
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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default If statement for a range of cells

Thank you, it worked perfectly.

On Monday, March 4, 2013 6:37:31 PM UTC-5, joeu2004 wrote:
[Sorry about the previous premature fat-finger send.]



wrote:

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.


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
change colors in a range of excel cells based on another range of cells Bobbi Muck Excel Programming 0 April 9th 10 01:44 AM
IF statement on a range of cells in Excel 2007 Harix Excel Worksheet Functions 5 February 14th 09 09:34 PM
IF Statement for Cells in a Range Confused_in_Houston[_2_] Excel Discussion (Misc queries) 4 October 31st 08 03:56 PM
Using variables as first and last cells in range statement Tom from Ga Excel Worksheet Functions 2 February 6th 06 09:08 PM
Copy a formula to a range of cells via VB6 using .Range(Cells(row,col), Cells(row,col)).Formula= statement Kevin Excel Programming 7 October 5th 04 08:11 PM


All times are GMT +1. The time now is 10:04 PM.

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"