Cell fill based on value of cell in row before

lee2121

New Member
Joined
Mar 14, 2017
Messages
41
Hello Everyone.

I have an excel file where i need the current cell to be filled with let's say a light red colour if the value entered into this cell is the same or less than the value in the cell above it.

For example

Cell A2 = 100 and Cell A1 = 110 then cell A2 should fill red and repeat for all other cells in the row.

I think a VBA solution may be best for this. I can do this in conditional formatting but i can't set up conditional formatting rules for each cell

The cells i need this to work on are Rows 2, 4, 6, 8 and 10

cell fill.png
 
Well maybe you should try Fluff's proposition then.
You probably misunderstood some of the instructions I gave you. I checked it again and no problem. Make sure you are referring to the correct cells in the formula.
Thank you for the reply this is how my formula looks after using the format painter.
 

Attachments

  • cell fill 5.png
    cell fill 5.png
    11.1 KB · Views: 5
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
In R1C1 style the formula, i think, should be :
Excel Formula:
=R[-1]C>RC
In your formula you are referencing cells 2 columns to the left and 2/3 rows down. It's not what i indicated.
 
Upvote 1
Solution
In R1C1 style the formula, i think, should be :
Excel Formula:
=R[-1]C>RC
In your formula you are referencing cells 2 columns to the left and 2/3 rows down. It's not what i indicated.
Thank you this work perfectly, yes for some reason my excel file is using RC cell references and not the normal A, b etc. But your revised code to reflect my file worked brilliantly.
 
Upvote 0

Forum statistics

Threads
1,223,840
Messages
6,174,953
Members
452,593
Latest member
Jason5710

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