Multiple conditions formula

Dsullivanre

New Member
Joined
Dec 12, 2016
Messages
2
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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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")))
 
Upvote 0
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")
 
Upvote 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"))))
 
Upvote 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"))))
 
Upvote 0
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",""))))
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top