Excel color question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Justin7
    SBR Hall of Famer
    • 07-31-06
    • 8577

    #1
    Excel color question
    Is there a way to change a cell to a specific color, based on an if statement?

    For example, Cell A1 will be 0 or 1. If it is a 1, I want cell A2 to turn from normal to Orange.
  • crjohnson32
    SBR Wise Guy
    • 12-16-10
    • 989

    #2
    look up "conditional formatting" in the help screen
    Comment
    • crjohnson32
      SBR Wise Guy
      • 12-16-10
      • 989

      #3
      If that helps, a kind word towards getting my pm's restored during the next skype meeting would be greatly appreciated!
      Comment
      • ProfaneReality
        SBR Hall of Famer
        • 04-14-09
        • 7607

        #4
        yeah goto conditional formatting then to color scales
        Comment
        • brad89
          SBR Sharp
          • 06-19-10
          • 424

          #5
          I don't know if you can set up color scales to work with custom IF statements but they will work for your example (-1=red, 0=orange, 1=green)

          I'm not sure if there is any easier way but the way I have it set up is.....

          In C1 I have (you can change/add to this depending on what you actually want)
          Code:
          =IF(A1=-1, "Red", IF(A1=0, "Yellow", IF(A1=1, "Green")))
          Then select column A and go to: Conditional formatting > manage rules > New rule

          Then set up three rules as follows:

          Code:
          =C1 = "Green"
          Click format > Fill > Select green

          Repeat for each one. Once you have done that you can hide column C if you like...

          Hopefully that makes sense, if not I can email you a basic template and you can can see how it is set up.
          Comment
          • allin1
            SBR MVP
            • 11-07-11
            • 4555

            #6
            interesting stuff about excel formatting http://www.contextures.com/xlcondformat03.html
            Comment
            • allin1
              SBR MVP
              • 11-07-11
              • 4555

              #7
              Originally posted by Justin7
              Is there a way to change a cell to a specific color, based on an if statement?

              For example, Cell A1 will be 0 or 1. If it is a 1, I want cell A2 to turn from normal to Orange.
              I have office 2007.

              In excel you can use conditional formatting to change the color of a cell depending on it's value.

              For example if A1 =1 -> color changes.
              This can be easily done selecting the cell->go to conditional formatting->new rule->format only cells that contain->
              select cell value->equal to->1->click on format tab and select different color. You can change the color of the text or the color of the fill.

              Click image for larger version

Name:	conditional formatting.jpg
Views:	1
Size:	47.3 KB
ID:	29110828 Click image for larger version

Name:	conditional formatting 2.jpg
Views:	1
Size:	44.9 KB
ID:	29110829

              Click image for larger version

Name:	conditional formatting 4.jpg
Views:	1
Size:	52.6 KB
ID:	29110834 Click image for larger version

Name:	conditional formatting 5.JPG
Views:	1
Size:	41.6 KB
ID:	29110835 Click image for larger version

Name:	conditional formatting 6.JPG
Views:	1
Size:	36.0 KB
ID:	29110836

              You can also use the data bar option if you like the style

              Click image for larger version

Name:	conditional formatting 3.JPG
Views:	1
Size:	43.8 KB
ID:	29110830

              I don't know if/how you can do it for different cells though, for example if A1=1 then A2 changes color, but I will get back with a post if I find out how.
              Comment
              • allin1
                SBR MVP
                • 11-07-11
                • 4555

                #8
                Originally posted by Justin7
                Is there a way to change a cell to a specific color, based on an if statement?

                For example, Cell A1 will be 0 or 1. If it is a 1, I want cell A2 to turn from normal to Orange.
                Originally posted by allin1

                I have office 2007.

                In excel you can use conditional formatting to change the color of a cell depending on it's value.

                For example if A1 =1 -> color changes.

                I don't know if/how you can do it for different cells though, for example if A1=1 then A2 changes color, but I will get back with a post if I find out how.
                I figured it out how you can do it.

                You select the cell A2, click "conditional formatting"-> select "new rule"->select "use formula to determine which cells to format"->
                enter the fomula: =$A1=1 , then click "format"-> select "fill" tab-> chose color.

                Click image for larger version

Name:	for justin.jpg
Views:	1
Size:	47.4 KB
ID:	29110831

                Click image for larger version

Name:	for justin 2.JPG
Views:	1
Size:	60.6 KB
ID:	29110832

                Click image for larger version

Name:	for justin 3.JPG
Views:	1
Size:	36.9 KB
ID:	29110833

                This conditional formatting seems quite useful. I found the formula by trial and error but my guess is that you can use all sorts of conditions like: if number in cell X is bigger than the number in cell Y then change the color or the value of cell Z.
                Comment
                Search
                Collapse
                SBR Contests
                Collapse
                Top-Rated US Sportsbooks
                Collapse
                Working...