ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If AND Statement (https://www.excelbanter.com/excel-worksheet-functions/92600-if-statement.html)

Lost and Looking for Help

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)

hans bal(nl)

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)


Pete_UK

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)



Arvi Laanemets

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)




Bruno Campanini

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



David Biddulph

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



Bruno Campanini

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




All times are GMT +1. The time now is 07:01 PM.

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