# Formulas in Conditional Formatting

#### broncos347

##### Active Member
I have a spreadsheet with a number of columns and I am trying to us a formula in conditional formatting to turn a cell a different colour should certain criteria be met.

Basically, column B has a number and column E has a date. What I am trying to do to change the cell in B a different colour should the number in B be higher than 50, but only if there is no date in column E.

I've tried the following formula but I can't get it to work:

-IF(AND(B1>49,E1=0,""))

Can anyone help?

### Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try just this:
=AND(B1>49,E1="")

You don't need the If statement, try

=AND(B1>49,E1="")

edit...or just to give you an alternative to Peter's...

=(B1>49)*(E1="")

or here is a bit of code

Code:
``````Sub colourB()

For i = 1 To 65536
If WorksheetFunction.And(Cells(i, 2) > 49, Cells(i, 5) <> 0) Then Cells(i, 2).Interior.ColorIndex = 3
Next i

End Sub``````
[/code]

Excellent, thanks all.

Replies
12
Views
885
Replies
5
Views
744
Replies
2
Views
307
Replies
3
Views
481
Replies
5
Views
419

1,211,788
Messages
6,103,981
Members
447,888
Latest member
eaydogan

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