+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting that displays one of two colours, depending on cell content

  1. #1
    Registered User
    Join Date
    02-10-2011
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    23

    Conditional formatting that displays one of two colours, depending on cell content

    Hi.

    Is there any way to create Excel 2010 conditional cell formatting such that if the cell content is one specific value (i.e. 0), the cell is filled with one colour, but if it contains another value (i.e. >=50), the cell is filled with a different colour? I would then need to copy that formatting down a whole column of cells.

    If that is possible, then I would ideally like to extend the fornmatting even further, by stating that if the cell value =0, but there is specific text in another separate column, then the cell shouldn't fill with the specified colour. If, however, the cell value is 0 and that specific text isn't present in that other column, then the cell must fill with the colour.

    I am thus really looking for three different conditional formatting rules applying to the same cell: a) cell content =0 and specific text in another column, b) cell content =0 without specific text in another column, and c) cell value >=50.

    Can this be done?

    Thanks.

  2. #2
    Registered User
    Join Date
    12-15-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Conditional formatting that displays one of two colours, depending on cell content

    Yes it can be done. All you need to do is create 2 conditional formatting rules on the same cell. Click in your first cell that you want highlighted (in this example its A1). In the home tab under styles select conditional formatting. At the bottom of the drop down select new rule. In the "select a rule type" window at the top of the dialogue box select "use formula to determine which cells to format". In the formula bar for the first rule copy and paste:

    =AND($A$1=0,$B$1="")

    Select your formatting. Then make another rule based on a formula in the same way but use the formula:

    =$A$1>50

    Then go back into the conditional formatting menu and select manage rules. in the field "applies to" just change it to the range that you want the highlights to come up in.

    Good Luck!
    If I helped you today please rate me

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional formatting that displays one of two colours, depending on cell content

    Hi

    Highlight your range. In Conditional Formatting rules, use these 3 differents formulae with 3 different colors.

    =AND($A1=0,$B1="TEXT")

    =$A1=0

    =$A1>=50
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    02-10-2011
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Conditional formatting that displays one of two colours, depending on cell content

    Thanks guys! I further complicated my own scenario a bit by wanting additional "exclusion conditions", as I got some unexpected cell fills due to other existing text entries in column B that I hadn't originally catered for, and thus also had to exlude from their effect on the conditional formatting of A1. Thankfully the AND formula allows one to keep adding comma-separated conditions as necessary. It thus worked a treat, although I assume that I needed to convert the absolute cell references to relative ones before applying the conditional formatting to all the cells of the column range.

    Appreciate the fast and accurate assistance!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.6.0 RC 1