# 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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},\$Z\$1:\$Z\$99,\$Y\$1:\$Y\$99),2,False) to lookup Y values to left of Z values.

#### seguin85

##### Active Member
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")))``

#### Eric W

##### MrExcel MVP
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")

#### Dsullivanre

##### New Member
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"))))

#### Tetra201

##### MrExcel MVP
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"))))

#### Anand Sharma

##### Board Regular
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
4
Views
286
Replies
3
Views
258
Replies
3
Views
1K
Replies
1
Views
318
Replies
5
Views
548 Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

### Forum statistics

1,163,899
Messages
5,834,299
Members
430,275
Latest member
Halis ### 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