# IF function with Conditional Formatting

#### Dennisr53

##### New Member
Hi everyone,

I am trying to create a formula that will look at the value( a number) in C29 and if it is larger than the value ( a number) in C31 then fill C29 with red, if the value is less then fill C29 with orange. I believe this can be done with the if function along with some conditional formatting. Any suggestions would be greatly appreciated. Thanks in advance for your help. =IF(C29<C31,"fill c29 red")+IF(C29>C31,"fill C29 orange") This is what I thought the formula might look like.

Last edited:

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi everyone,

I am trying to create a formula that will look at the value( a number) in C29 and if it is larger than the value ( a number) in C31 then fill C29 with red, if the value is less then fill C29 with orange. I believe this can be done with the if function along with some conditional formatting. Any suggestions would be greatly appreciated. Thanks in advance for your help. =IF(C29<c31,"fill c29="" red")+if(c29="">C31,"fill C29 orange") This is what I thought the formula might look like.
Hi Dennisr53, welcome to the boards.

This should be fairly simple to achieve.

Select cell C29, go to conditional formatting and create a new rule.
Select the bottom option "Use formula to determine which cells to format"
In the formula bar type in =C29 > C31 (without the spaces)
Click the Format box and select the red fill.
Click OK

Now create a second new rule
Select the bottom option "Use formula to determine which cells to format"
In the formula bar type in =C29 < C31<c31
(without the spaces)
Click the Format box and select the orange fill.
Click OK

</c31
</c31,"fill>

You rarely need an IF function in conditional formatting. You are looking to create TRUE/FALSE answer. So something like =C29>C31

Thanks a lot Fishboy. That worked like a champ. I guess I was overthinking what I wanted to do.

Thanks a lot Fishboy. That worked like a champ. I guess I was overthinking what I wanted to do.
You're welcome mate. Happy to help.

Thank you for responding Steve the fish. You were thinking in the right direction but Fishboy had the solution that was simple and worked. Thanks again.

Replies
2
Views
147
Replies
3
Views
154
Replies
6
Views
536
Replies
3
Views
131
Replies
4
Views
442

1,196,409
Messages
6,015,106
Members
441,870
Latest member
kojack

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