Conditional Formatting linked to value in a cell

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
259
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have a range of data a1:d4 (4 rows x 4 columns range). I also have a range of data in column e1:e4. If I populate E1 with the value 2, I want the second cell in the range a1:d1 to be formatted with a green fill (B1).

If I populate E4 with the number 3, I want the third cell over in the row to be formatted with a green fill (C3).

If there are no values in the e1:e4 range, then there is no conditional formatting required.

Any help appreciated.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Select cell B1 then select conditional formatting in the ribbon area (under Home I think), select the option to use a true/false formula to determine format. Then put =E1=2 ... and under the format to apply pick the color to fill. Same idea for setting E4.
 
Last edited:
Upvote 0
My dataset is a lot bigger, I cut it down for the purposes of the request - does your post mean that I would have to select every cell individually?

BTW - Thanks for taking time to review this.
 
Upvote 0
No prob, and no you just select the entire range that needs to be formatted and the formula you write is based on the first cell in the range... conditional formatting will know to adjust the formula for each cell in the selection as if you had dragged the formula.

Like if your criteria formula was =$E$1=2 then for every cell selected it will only look at E1 but if you remove the dollar signs, then the second cell in the conditionally formatted range will format based on E2 ... =E2=2 ...assuming the range is a single column going down.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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