If AND Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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)
 
What you need is this:

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

Hope this helps.

Pete
 
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<at>tarkon.ee )


"Lost and Looking for Help"
 
"Lost and Looking for Help"
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
 

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

Back
Top