Conditional formatting with cell column ranges

Jadegirl

Board Regular
Joined
Apr 20, 2011
Messages
65
Conditional formatting with cell column ranges

Is there a way to use conditional formatting for cell ranges - for example, I would like to color code major changes of 25% increase in purple and 25% decrease in orange.

I have column A with values I want to compare against Column B

For example:
column A column B Column C (Goal)
100 72 orange
200 180 do nothing
100 125 purple
100 124 do nothing
100 126 purple

I would like to try this in both the reg. excel & with pivot tables.
Also, is there a formula way to do the row and the cell?

Using Excel 2007

Thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This should get you started.

Code:
Sub Color_Coding()
Dim LR As Long
Dim i As Long

LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To LR
    If Range("B" & i) <= (Range("A" & i) * 0.75) Then
        Range("C" & i).Interior.Color = 26367
    ElseIf Range("B" & i) >= (Range("A" & i) * 1.25) Then
        Range("C" & i).Interior.Color = 10498160
    End If
Next i

End Sub
 
Upvote 0
Or with Conditional Formatting

Excel Workbook
AB
110072
2200180
3100125
4100124
5100126
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B11. / Formula is =B1>=A1*1.25Abc
B12. / Formula is =B1<=A1*0.75Abc
 
Upvote 0
Thanks - can you help me a little. I have never used codes so I am a little nervous about doing it. Is there another way?
 
Upvote 0
Below is a picture of what I got and what I would like to get. Can you let me know what I am doing wrong?

ahhh.. not sure how to post pics...
 
Last edited:
Upvote 0
I tried the formula below, but I can't get it to work with the outcome shown below. Thoughts to what I am doing incorrect?
Thanks
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,548
Members
452,927
Latest member
rows and columns

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
Back
Top