# IF, AND, OR?

#### micahthomas

##### New Member
I'm having trouble with and IF statement.

I have 3 columns, 2 manual entries, and then a calculation.
In my calculation formula, I need an if statement before the calculation.

Here's what I want:

If A2=0 and B2=0, then C2="" (or just empty)
AND if A2=0, **while B2 could be any number** then C2=1

What do I need to do?

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
=IF(AND(A2=0,B2=0),"",IF(AND(A2=0,ISNUMBER(B2)),1))

=IF(A2,"?",IF(N(B2),1,""))

Does this do what you want?

=IF(AND(A3=0,B3=0),"",IF(AND(A3=0,B3<>0),1,0))

YES, KWMSeattle you get the prize. Thanks so much. I think the trick is the B3<>0. What does that tell the formula to do? It works like a charm. Thank you!

"<>" = "does not equal"

Replies
3
Views
199
Replies
2
Views
229
Replies
4
Views
474
Replies
5
Views
453
Replies
1
Views
216

1,220,965
Messages
6,157,122
Members
451,399
Latest member
alchavar

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back