Ifs Statement with inequalities

WashingtonDC

New Member
Joined
Sep 19, 2016
Messages
12
Can I write an Ifs statement that contains several inequalities? Below are the criteria:

If Cell >=15% then value= 1
If cell is between 6%-14% then value= 2
If cell is between -5% and 5% then value = 3
If cell is between -6% and -15% then value = 2
If cell is less than -15% then value = 1
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
try, with cell in A1

=IF(OR(A1<-0.15,A1>=0.15),1,IF(AND(A1>=0.05,A1<=-0.05),3,2))
 
Upvote 0
Since the positive and negative values are mirror images of each other, you can simplify it a bit by taking advantage of the Absolute Value function (ABS), i.e.
Code:
=IF(ABS(A1)>=0.15,1,IF(ABS(A1)>=0.06,2,3))
 
Upvote 0
Here is a way:

=IF(ISNUMBER(A1),IF(ABS(A1)>=0.15,1,IF(ABS(A1)>0.05,2,3)),"")
 
Upvote 0
=IF(A1<-15%, 1, IF(A1<=-6%, 2, IF(A1<=5%, 3, IF(A1<15%, 2, 1))))

Note that if A1 is 5.1%, a condition that you do not cover, the formula returns 2. To avoid that, be sure that A1 is rounded to 0 percentage decimal places.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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