Conditional Formatting - Relative References

Carly

Active Member
Joined
Aug 21, 2002
Messages
370
I have got a spreadsheet where in D5 I want to have the following conditional formatting:

If D5 is blank then nothing
If D5 < C5 then Red
If D5 >= C5 then Green

I can get this to work on D5, but when I want to copy & paste the data down the cell from D5 to D100 then the absolute references kick in and always look at C5 instead of the relative row.

Can anyone advise what I am doing wrong?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi Carly,

Is this what you want?...


Excel Workbook
CD
51525
67055
74535
86040
95545
105030
114550
124060
137565
143070
159575
Carly



Conditional Formatting formula for green is....

=$D5>=$C5

For red is....

=$D5<$C5

Make sure you highlight your range from D5 down.

I hope that helps.

Ak
 
Upvote 0
Thank you, this works, but is extremely temperamental :( Have to go back in a number of times to change the references back to C5 & D5 as it jumps to way down the sheet.

Random.

Do you know what I would add in if I wanted it to be 'No Format' if D5 was blank?
 
Upvote 0
Hi Carly,

Try this for red...

=AND($D5<>"",$D5<$C5)

Excel Workbook
CD
515*
67055
74535
86040
955*
105030
114550
124060
137565
143070
159575
Carly



I hope that works for you.

Ak
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,912
Members
452,949
Latest member
beartooth91

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