Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Michigan, USA
    Posts
    408
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cell Color (Again!) (Excel XP-SP3)

    I know this has been discussed in detail - and I have read the posts - but can't seem to find the answer to my particular question. I want to color the text in a cell based on one of four conditions. Basically, if the results of a formula is one of 4 words, I want to color the text in that cell the same color as the word (Red, Green, Yellow, and Orange). Conditional formatting only allows 3 conditions and I would prefer not using a macro since the users of this sheet are Excel challenged. I need to keep it simple so they can understand and use/make changes. I was hoping I could do a formula that says if cell x1="yellow", text color (some number representing the color yellow)x1... Is this at all possible without using VBA code?

    TIA
    <font face="Comic Sans MS"><big><font color=4682b4>Sherry</font color=4682b4></big></font face=comic>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cell Color (Again!) (Excel XP-SP3)

    If the cell will always contain one of the four words, you can use one of the colors as the default text color; together with the 3 conditional formatting options, you'd have 4 possible colors. If the cell can also contain other words that should be black (or something like that), that won't work. I don't know of a way to do this without VBA. Formulas cannot change cell formatting.

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Cell Color (Again!) (Excel XP-SP3)

    There is 1 workaround I know to get a total of 7 colors:
    1) the explicit color (does not meet any conditions)
    2,3,4) the 3 conditions from conditional formatting
    5,6,7) a custom format. These 3 would require checking for a number not text. A custom format like:
    <!t>[Red]<!/t>"Red";<!t>[Blue]<!/t>"Blue";<!t>[Green]<!/t>"Green"

    For the last 3 colors, you would not enter in text but numbers.
    If a number were >0 the cell would display <font color=red>Red</font color=red> (the text value "Red" in red)
    If <0 it would display <font color=blue>Blue</font color=blue>
    and if =0 <font color=448800>Green</font color=448800>

    So you use a pos/neg/0 value for 3 colors (not the color as text), you check the cell contents for 3 other colors (cond formats like: "cell value" equal to "Yellow" and format the text to yellow,"cell value" equal to "Cyan" and format the text to cyan, "cell value" equal to "Magenta" and format the text to magenta, and finally if the cell value was not a number and not any of those 3 colors it would be the explict color (eg Black)

    Steve

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cell Color (Again!) (Excel XP-SP3)

    I knew about this trick to get 7 colors, but didn't think of using it here because you have to enter numbers instead of words. If that is acceptable to the OP, it's a very good solution. <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •