+ Reply to Thread
Results 1 to 12 of 12

Thread: How to color a cell according to its content

  1. #1
    Registered User
    Join Date
    04-29-2010
    Location
    Earth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Question How to color a cell according to its content

    The cell location is B2.

    Cell content can be either "+" or "-".

    I want to change the background color of B2 to green if its content is "+".
    I want to change the background color of B2 to red if its content is "-".

    How can I do this?

    Thanks.
    Last edited by davesexcel; 04-30-2010 at 07:55 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: How to color a cell according to its content

    Search the Forum for Conditional Formatting

  3. #3
    Registered User
    Join Date
    04-29-2010
    Location
    Earth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Unhappy Re: How to color a cell according to its content

    Thank you for quick reply.

    I have already tried conditional formatting. It works when working with numbers, but has no effect when working with text.
    Last edited by davesexcel; 04-30-2010 at 07:54 PM.

  4. #4
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: How to color a cell according to its content

    Conditional formatting works with text, use "+" and "-"
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: How to color a cell according to its content

    Try
    Cell Value is Equal to ="-"
    Cell Value is Equal to ="+"

    In the conditional format window

  6. #6
    Forum Guru Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    Excel 2010
    Posts
    1,249

    Re: How to color a cell according to its content

    Maybe provide an example worksheet and we can give you specific help to your problem.

  7. #7
    Registered User
    Join Date
    04-29-2010
    Location
    Earth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Arrow Re: How to color a cell according to its content

    I tried writing ="+" and ="-" instad of simply writing + and -.
    Doing this way, the demonstration in the cell didn't change, in other words, it didn't work.

    Thanks in advance.
    Last edited by davesexcel; 04-30-2010 at 07:54 PM.

  8. #8
    Registered User
    Join Date
    04-29-2010
    Location
    Earth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Lightbulb Re: How to color a cell according to its content

    I attached the Excel file I'm working on.
    Attached Files Attached Files
    Last edited by davesexcel; 04-30-2010 at 07:54 PM.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: How to color a cell according to its content

    You are not using conditional formatting in your example.

    Here's is your workbook using conditional formatting.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-29-2010
    Location
    Earth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Thumbs up Re: How to color a cell according to its content

    Wooow, that's perfect, how did you do that?
    Thanks alot!
    Last edited by davesexcel; 04-30-2010 at 09:39 AM.

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: How to color a cell according to its content

    Quote Originally Posted by hkBattousai View Post
    I have already tried conditional formatting. It works when working with numbers, but has no effect when working with text.
    Did you not already try conditional formatting?

    Check this out.

    http://www.contextures.com/xlCondFormat01.html

  12. #12
    Registered User
    Join Date
    04-29-2010
    Location
    Earth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Smile Re: How to color a cell according to its content

    Thank you so much for your help!
    Last edited by davesexcel; 04-30-2010 at 07:54 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0