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
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

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
54,388
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))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,282
Messages
5,836,388
Members
430,425
Latest member
xlsee

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