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!
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

seguin85

Active Member
Joined
Mar 17, 2015
Messages
265
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Aug 18, 2015
Messages
10,602
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
Joined
Dec 12, 2016
Messages
2
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
Joined
Oct 14, 2016
Messages
3,631
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
Joined
Nov 22, 2016
Messages
63
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",""))))
 

Watch MrExcel Video

Forum statistics

Threads
1,122,193
Messages
5,594,774
Members
413,934
Latest member
austinb

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
Top