Changing Cell Color based on value (Not same Cell)

youga924

New Member
Joined
Aug 7, 2014
Messages
4
Hi! I would like to know if there's a way to make a cell change color depending on the value of another cell, i have minimum knowledge about conditional formatting but I'm guessing it can only be used to condition the cell with the value as as I'm trying to color a different cell than the one containing the value, I suppose I'd need some If statement code thingies or such... HALP PLX? :eek:
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
youga924, Good morning.

Yes, you can use any kind of formula to starts a Conditional Formatting.

Please, give us some more details to easier us help you.
 
Upvote 0
Go into "conditional formatting" select "new rule" then select "use a formula to determine which cells to format. If you want to format cell E1 based on the value in another cell enter =E1=A1 and select how you want E1 to be formatted (yellow fill for example). Then go back to "conditional formatting" and select "manage rules" you should then be able to add additional criteria for E1. Once you enter the 2nd rule you should just be able to keep hitting "new rule" to add as many as you want. Hope this makes sense as I wasn't able to post a screen shot for your reference.
 
Upvote 0
I'm doing a kind of checklist which is completed by inputting 0's or 1's, depending on the sum of these numbers is whether it's incomplete or not, for example, sum=0 results in red color, sum between 1-11 results in yellow color fill and 12 (total number of elements) results in green fill... but all this checklist is part of a bigger checklist... all of this is just one of several titles or bullets in the master checklist so to speak... i don't know if i'm being clear :S

what i want to do is... depending on the sum of the checklist.. copy that format to a cell which would be adjacent to the BULLET or TITLE for this specific part of the master checklist as to see which bullet points or tasks are still undone or incomplete... all of these subgroups will be collapsible/expandible.
 
Upvote 0
Go into "conditional formatting" select "new rule" then select "use a formula to determine which cells to format. If you want to format cell E1 based on the value in another cell enter =E1=A1 and select how you want E1 to be formatted (yellow fill for example). Then go back to "conditional formatting" and select "manage rules" you should then be able to add additional criteria for E1. Once you enter the 2nd rule you should just be able to keep hitting "new rule" to add as many as you want. Hope this makes sense as I wasn't able to post a screen shot for your reference.


I think this could very much be the way to go, thanks! except i don't know how to format one in terms of another... do all rules begin with "="? Am i just supposed to totally format one of them and then copycat that onto the other cell? so to speak.
 
Upvote 0
Would you mind creating a table in a reply to show an example of what a subgroup looks like?

When you go to type a reply, at the bottom right click the "Go Advanced" button and then you'll be redirected to a reply page that has table tools under the font controls.

Thanks
 
Upvote 0
Yes, the rule is always = then select the cell you want to format then do = and select the sell you want to use for the format requirement.
 
Upvote 0
I would actually like to know how to do this as well, but the code for it in VBA rather than using the conditional formatting box.

I have two cells that I would like the color the first cell based on the conditions of both cells.
Example:
If A1= "Phase 1", B1= (>=-20) then color A1 green
else
A1= "Phase 2", B1= (-6 To -19) then color A1 yellow
else
A1= "Phase 3", B1= (<=5) then color A1 red

Plus I have to repeat this 7 times for the different words in A1, and change the code for the numbers. I also wrote a Case statement that defines red, yellow and green in a seperate cell C1. But it doesn't like the negative numbers, and doesn't always give me the right result for yellow.
Code:
Function LaunchStatus(G As Range, I As Range) As String
    Dim sLaunch As String
    Select Case G.Value
        Case "Phase 1", "Phase 2", "Phase 3"
            ' Color determined by column I
            Select Case I.Value
                Case Is <= (-20):              sLaunch = "Green"
                Case (-6) To (-19):           sLaunch = "Yellow"
                Case Else:                        sLaunch = "Red"
            End Select
 
Upvote 0
:)title 1expandclose
:)title 2expandclose
:oops:title 3expandclose
ElementValue
-A1
-B0
-C1
-D1
TOTAL3
:)title nexplandclose

<tbody>
</tbody>

This is roughly what it looks like... basically i have elements which can be either satisfactory (1) or unsatisfactory (0). If you look at the table you'll see I pasted emoticons because i have no idea how to color the cells here 'o_O but basically smiley faces would stand for green color or "all satisfactory" and the red icons would be red cells meaning not everything is satisfactory or being met. So basically im trying to put a color status on the title of that expanded section depending on the "TOTAL" cell because that's where i can tell if all values are 1's... i hope its clearer now

THANKS!!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

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