# formula for less than or equal to

#### TonyW1234

##### New Member
Hi,

Please could anyone advise how to add a formula to work out if a value is > or equal to a number using an or statement, I currently have this formula but it doesnt seem to work

=IF(OR(Y2>0<=1185),5,IF(OR(Y2>1185<=4242),7,0))
thanks

Tony

### Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You need to test each time:

Code:
``=IF(OR(Y2>0,Y2<=1185),5,IF(OR(Y2>1185,Y2<=4242),7,0))``

Try this:
Code:
``=IF(OR(Y2>0,Y2<=1185),5,IF(OR(Y2>1185,Y2<=4242),7,0))``

thanks a lot for that, just what i needed

Tony

thanks a lot for that, just what i needed

Tony
Hmmm, I'm wondering just what it was you did need - the answer 5 always?

I can't think of any number you could put in Y2 that would fail the first test..
OR(Y2>0,Y2<=1185)

I'm just guessing, but maybe you really wanted this?
Code:
``=IF(AND(Y2>0,Y2<=1185),5,IF(AND(Y2>1185,Y2<=4242),7,0))``

Replies
3
Views
182
Replies
12
Views
280
Replies
6
Views
446
Replies
9
Views
296
Replies
1
Views
238

1,216,102
Messages
6,128,853
Members
449,472
Latest member
ebc9

### 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