#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lost and Looking for Help
 
Posts: n/a
Default If AND Statement

I have a number in Cell A1 and A2 for example.

I want a formula that says, that IF A1 and A2 are both Zero, then to place a
zero in the the cell, if false divide A1/A2. Here is the formula i used but
it obviously doesn't work

=IF(A1=0 and A2=0,0,A1/A2)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hans bal(nl)
 
Posts: n/a
Default If AND Statement

Use = IF( AND(A1=0,A2=0),0,A1/A2)

HTH


"Lost and Looking for Help" wrote:

I have a number in Cell A1 and A2 for example.

I want a formula that says, that IF A1 and A2 are both Zero, then to place a
zero in the the cell, if false divide A1/A2. Here is the formula i used but
it obviously doesn't work

=IF(A1=0 and A2=0,0,A1/A2)

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK
 
Posts: n/a
Default If AND Statement

What you need is this:

=IF(AND(A1=0,A2=0),0,A1/A2)

Hope this helps.

Pete

Lost and Looking for Help wrote:
I have a number in Cell A1 and A2 for example.

I want a formula that says, that IF A1 and A2 are both Zero, then to place a
zero in the the cell, if false divide A1/A2. Here is the formula i used but
it obviously doesn't work

=IF(A1=0 and A2=0,0,A1/A2)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Arvi Laanemets
 
Posts: n/a
Default If AND Statement

Hi

When A1=0, then the result is zero anyway, except A2=0 too.
When A1<0, but A2=0, then dividing retuns an error with checking you
wanted.

Probably you need a formula
=IF(A2=0,0,A1/A2)


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )


"Lost and Looking for Help"
wrote in message
...
I have a number in Cell A1 and A2 for example.

I want a formula that says, that IF A1 and A2 are both Zero, then to place
a
zero in the the cell, if false divide A1/A2. Here is the formula i used
but
it obviously doesn't work

=IF(A1=0 and A2=0,0,A1/A2)



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bruno Campanini
 
Posts: n/a
Default If AND Statement

"Lost and Looking for Help"
wrote in message
...
I have a number in Cell A1 and A2 for example.

I want a formula that says, that IF A1 and A2 are both Zero, then to place
a
zero in the the cell, if false divide A1/A2. Here is the formula i used
but
it obviously doesn't work

=IF(A1=0 and A2=0,0,A1/A2)


You must take into account A2=0

=IF(NOT(A2),0,A1/A2)

Bruno




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph
 
Posts: n/a
Default If AND Statement

"Bruno Campanini" wrote in message
...
"Lost and Looking for Help"
wrote in message
...
I have a number in Cell A1 and A2 for example.

I want a formula that says, that IF A1 and A2 are both Zero, then to
place a
zero in the the cell, if false divide A1/A2. Here is the formula i used
but
it obviously doesn't work

=IF(A1=0 and A2=0,0,A1/A2)


You must take into account A2=0

=IF(NOT(A2),0,A1/A2)


Can't you therefore say
=IF(A2,A1/A2,0) ?
--
David Biddulph


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bruno Campanini
 
Posts: n/a
Default If AND Statement

"David Biddulph" wrote in message
...

Can't you therefore say
=IF(A2,A1/A2,0) ?
--
David Biddulph


Yes, of course.
Saving 5 bytes...

Bruno


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
Returning Specific Cell Content using IF Statement weeclaire Excel Discussion (Misc queries) 2 February 17th 06 01:48 PM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
How do I fix a circular reference in a financial statement? drjayhawk25 Excel Discussion (Misc queries) 0 February 7th 05 05:19 PM


All times are GMT +1. The time now is 10:46 AM.

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"