formula for less than or equal to

TonyW1234

New Member
Joined
Jul 26, 2007
Messages
31
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
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You need to test each time:

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

Lewiy

Well-known Member
Joined
Jan 5, 2007
Messages
4,284
Try this:
Code:
=IF(OR(Y2>0,Y2<=1185),5,IF(OR(Y2>1185,Y2<=4242),7,0))
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
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? :confused:

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

Watch MrExcel Video

Forum statistics

Threads
1,123,488
Messages
5,601,976
Members
414,488
Latest member
rjp847

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