# Cell Format Rule Formula - A>=X<=B

#### SLVRGHST

##### New Member
Hi All,

I am trying to solve a cell formatting problem and I hope one of you fine people can lend a hand. I have a range of cells that I would like to format with a red fill if the following conditions are met:
If the number value is less than 10 OR is greater than 15 but less than 22​

I tried the following formula in the format rule for this and I can only get the cell to fill in with red when the first part is true:
=OR(M30<=10,15>=M30<=22)​

It's almost as if the second part of the OR is totally ignored. I do not get any errors with the formula or the rule when it is applied. Can someone tell me what I am missing here? It would be greatly appreciated.

Cheers!

### Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### AliGW

##### Banned
Try this:

=OR(M30<10,AND(M30>15,M30<22))

Last edited:

#### cnestg8r

##### Active Member
=or(a1<10,and(a1>15,a1<22))

#### SLVRGHST

##### New Member
Thank you AliGW, works perfectly. So Excel doesn't manage the 15>=M30<=22 very well but does not throw an error. Any idea why? That would help me understand what to watch out for next time.

#### SLVRGHST

##### New Member
Thank you too cnestg8r. If you have the answer as to why as well, please feel free to comment... or point me to a resource that explains if you know one?

Replies
3
Views
274
Replies
3
Views
265
Replies
1
Views
592
Replies
2
Views
677
Replies
3
Views
1K

1,191,322
Messages
5,985,976
Members
439,994
Latest member
lalkelalke04

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