Forum Discussion

ChrisBlair's avatar
ChrisBlair
Copper Contributor
Jul 25, 2019
Solved

assigning a numerical value to a colored cell

Good Day All,

I have a co-worker who has used 'fill color' to assign a relative risk. Green = Low, Yellow = Medium, Orange = High, and Red = Significant based on the impact to the overall requirement. I am trying to find out if I am able to assign a numerical value to the colored cells without typing in the number into each cell? Green = 1, Yellow = 2, Orange = 3, and Red = 4.

 

Thank you

 

Chris

  • ChrisBlair 

    I am happy I could help you Chris

    Please mark the answer as "Accepted " and Like .

    Thank you :) 
    Good Luck

    Nabil Mourad

7 Replies

  • ChrisBlair 

    Hi Chris

    If you want to assign a number based on brackets of numbers in another cell or may be text options in another cell then, in an adjacent cell, you need to create a conditional If function (or could be a Vlookup with approximate match)
    then you apply regular conditional formatting to the numbers column. Set the fill color to be the same as the Font color. Having both of the same color will make the numbers invisible.

    There are 2 conditional formatting options that enable you to hide the numbers those are "Data Bars" and "Icon Sets" . If you click on Manage Rule >> and check the box for "Show Bar Only" or "Show Icon Only" but these 2 types do not fill the cell with color.

    If you share a sample file I'll be able to give a more accurate answer based upon the work situation.

    Hope that Helps

    Nabil Mourad

     

    • ChrisBlair's avatar
      ChrisBlair
      Copper Contributor

      nabilmourad 

      Thank you for your answer. I have attempted to attach a basic spreadsheet with cells filled with the colors I am using. I am not sure how to correctly write the 'IF' statement for assigning a value based off the color.

       

      Any assistance is greatly appreciated.

       

      Chris

      • nabilmourad's avatar
        nabilmourad
        MVP

        ChrisBlair 

        Hi Chris,

        When I recommended an If statement (before you attach a file), I assumed that you are coloring the cells based on a conditional formatting rule that reads a value. 
        Now the situation when I look at your file is totally different because I cannot create a conditional rule that returns a number based on color (Except in VBA- I can send you a link for that but it's complicated).
        So, alternatively, I am going to use a very simple technique to select All Cells with a specific color and type a number in All of them simultaneously:

        1. Click on "Find & Select" to the right side of the Home Tab
        2. Select Find...
        3. Click on Options >> The box expands
        4. Click on Format >> Select the Eye Dropper tool
        5. Click on one of the colors in the worksheet
        6. Click Find All >> The box Expands
        7. Hit CTRL +A >. you selected All cells of that color
        8. Close the Find box and Do Not Click anywhere
        9. Type the number (Say 1) Then Hit CTRL + ENTER (not enter)
        10. Repeat for each Color

         

        Hope that Helps

        Nabil Mourad

Resources