Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default IF, AND, What is wrong with this formula?

The cells in the formula below contain formula themselves; could this
be why it is not working?
"False" is being returned whether or not the values of each of these
cells are zero.
I have not used =IF(SUM(AR187:BC187)=0,"True","False") because there
may be a compensating negative and positive in the range.

'=IF(AND(AR187,AS187,AT187,AU187,AV187,AW187,AX187 ,AY187,AZ187,BA187,BB187,BC187)=0,"True","False")

many thanks to anyone who can help.
Dave Moore
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF, AND, What is wrong with this formula?

Maybe

=IF(COUNTIF(AR187:BC187,"=0")=12,"True","False")

Mike

"DaveMoore" wrote:

The cells in the formula below contain formula themselves; could this
be why it is not working?
"False" is being returned whether or not the values of each of these
cells are zero.
I have not used =IF(SUM(AR187:BC187)=0,"True","False") because there
may be a compensating negative and positive in the range.

'=IF(AND(AR187,AS187,AT187,AU187,AV187,AW187,AX187 ,AY187,AZ187,BA187,BB187,BC187)=0,"True","False")

many thanks to anyone who can help.
Dave Moore

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default IF, AND, What is wrong with this formula?

Dave
Each reference has to evaluate to 0

eg. =IF(AND(B7=0,C7=0,D7=0),"True","False")

Hope this helps
Peter

"DaveMoore" wrote:

The cells in the formula below contain formula themselves; could this
be why it is not working?
"False" is being returned whether or not the values of each of these
cells are zero.
I have not used =IF(SUM(AR187:BC187)=0,"True","False") because there
may be a compensating negative and positive in the range.

'=IF(AND(AR187,AS187,AT187,AU187,AV187,AW187,AX187 ,AY187,AZ187,BA187,BB187,BC187)=0,"True","False")

many thanks to anyone who can help.
Dave Moore

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default IF, AND, What is wrong with this formula?

Hi Dave
Probably due to small rounding errors
try
=IF(ROUND(SUM(AR187:BC187),0)=0,"True","False")

--
Regards
Roger Govier

"DaveMoore" wrote in message
...
The cells in the formula below contain formula themselves; could this
be why it is not working?
"False" is being returned whether or not the values of each of these
cells are zero.
I have not used =IF(SUM(AR187:BC187)=0,"True","False") because there
may be a compensating negative and positive in the range.

'=IF(AND(AR187,AS187,AT187,AU187,AV187,AW187,AX187 ,AY187,AZ187,BA187,BB187,BC187)=0,"True","False")

many thanks to anyone who can help.
Dave Moore


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default IF, AND, What is wrong with this formula?

On Tue, 4 Mar 2008 02:56:03 -0800 (PST), DaveMoore
wrote:

The cells in the formula below contain formula themselves; could this
be why it is not working?
"False" is being returned whether or not the values of each of these
cells are zero.
I have not used =IF(SUM(AR187:BC187)=0,"True","False") because there
may be a compensating negative and positive in the range.

'=IF(AND(AR187,AS187,AT187,AU187,AV187,AW187,AX18 7,AY187,AZ187,BA187,BB187,BC187)=0,"True","False")

many thanks to anyone who can help.
Dave Moore


The problem is that you are not understanding the syntax for the AND worksheet
function.

If you were to use the AND function to test to see if all the cells have a
value of zero, you need to write:

=IF(AND(AR187=0,AS187=0,AT187=0,...),"True","False ")

Another way of writing this, again using the AND function, would be

=AND(AR187:BC187=0)

Entered as an ARRAY formula, it will return TRUE if all are zero (or blank),
and false if any are not. (It returns the TRUE or FALSE as Boolean values, and
not as text values as will your IF statement. If you require TEXT values, then
just wrap it in an IF statement: =IF(AND(AR187:BC187=0),"True","False") --
also ARRAY-ENTERED).

To enter an ARRAY formula, hold down <ctrl<shift while hitting <enter.

If you also want to return FALSE if any of the entries are blank, then:

=AND(AR187:BC187=0,ISNUMBER(AR187:BC187)) also entered as an array formula.
--ron
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
What is wrong with this formula? Gary[_2_] Excel Worksheet Functions 3 October 29th 07 02:29 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
What's wrong with this formula? JHL Excel Worksheet Functions 3 June 10th 06 02:09 AM
Can anyone tell me what's wrong with this formula? Linda Excel Worksheet Functions 5 April 12th 06 07:25 PM
formula around wrong way Micayla Bergen Excel Discussion (Misc queries) 3 June 6th 05 06:44 AM


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"