# Multiple conditions formula

#### Dsullivanre

##### New Member
Hi Everyone, thanks for taking the time to help me out!

I tried to search in the help in excel, on how to do a multiple condition formula, using If And / IF statements, with no luck.

How do I get the following to be in 1 formula:

A1=0 & B1=0 return in C1 "A"
A1>0 & B1=0 return in C1 "B"
A1=0 & B1>0 return in C1 "C"
A1>0 & B1>0 return in C1 "D"

Thanks again!

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
This should work, in cell C1 enter:
Code:
``=IF(A1=0,IF(B1=0,"A",IF(B1>0,"C")),IF(A1>0,IF(B1=0,"B","D")))``

Welcome to the forum.

Maybe:

=IF(A1=0,IF(B1=0,"A","C"),IF(B1=0,"B","D"))

This doesn't handle any case where A1 or B1 is less than 0 though. You'd need something like:

=IF(AND(A1=0,B1=0),"A",IF(AND(A1>0,B1=0),"B",IF(AND(A1=0,B1>0),"C",IF(AND(A1>0,B1>0),"D","Something is below 0"))))

to handle that. Or maybe if you have the new IFS function:

=IFS(AND(A1=0,B1=0),"A",AND(A1>0,B1=0),"B",AND(A1=0,B1>0),"C",AND(A1>0,B1>0),"D",TRUE,"Something is below 0")

Thanks guys! I appreciate the help!

This worked: =IF(AND(A1=0,B1=0),"A",IF(AND(A1>0,B1=0),"B",IF(AND(A1=0,B1>0),"C",IF(AND(A1>0,B1>0),"D","Something is below 0"))))

Too late, but here is a shorter version:

=IF(OR(A1<0,B1<0),"Out of range",IF(A1+B1=0,"A",IF(A1*B1>0,"D",IF(A1=0,"C","B"))))

Hi,

Your conditions is based on A1 and B1, when both conditions meet , try using if with and operator as below

=IF(AND(A1=0,B1=0),"A",IF(AND(A1>0,B1=0),"B",IF(AND(A1=0,B1>1),"C",IF(AND(A1>0,B1>0),"C",""))))

Replies
25
Views
542
Replies
1
Views
280
Replies
9
Views
186
Replies
10
Views
637
Replies
0
Views
105

### Forum statistics

1,203,760
Messages
6,057,210
Members
444,914
Latest member
Mamun12345 ### 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