+ Reply to Thread
Results 1 to 11 of 11

Conditional Formatting

  1. #1
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Conditional Formatting

    Hi

    I want to change color based on the value in the range. -

    First im not sure about what formula to use and also conditional formatting multiple color in the same rule - Please help me

    e.g.

    A B C Status
    yes yes yes Green color
    yes no yes Amber color
    yes n/a yes Amber color
    yes no n/a Amber color

    Thanks
    Thiru

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Conditional Formatting

    Hello,

    you need one rule for each color.

    for amber: =COUNTIF($A1:$C1,"yes")<3
    for green: =COUNTIF($A1:$C1,"yes")=3

    CFformula.gif

    If you want the color in a different column just apply the format to D1:D4 instead of A1:C4

    cheers, teylyn

  3. #3
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Re: Conditional Formatting

    Quote Originally Posted by teylyn View Post
    Hello,

    you need one rule for each color.

    for amber: =COUNTIF($A1:$C1,"yes")<3
    for green: =COUNTIF($A1:$C1,"yes")=3

    Attachment 432147

    If you want the color in a different column just apply the format to D1:D4 instead of A1:C4

    cheers, teylyn

    Hi Sir - Thank you very much for your reply - Few clarification required.

    1. So we cannot use multiple colors in the same rule? - Is that right?
    2. Is there any other to mention multiple criteria e.g. finding two or more criteria in a range
    if(range = "criteria1" or range= "crtieria2" or range = "criteria3") - Something like this.

    Thanks
    Thiru

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Conditional Formatting

    For second CF in same cell, just stay at that cell, apply new rule for new condition. This second CF will be in 2nd priority.
    Quang PT

  5. #5
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Re: Conditional Formatting

    Quote Originally Posted by bebo021999 View Post
    For second CF in same cell, just stay at that cell, apply new rule for new condition. This second CF will be in 2nd priority.
    Thank you

    So only one rule for one color!

    And do you got any idea regarding criteria i.e. Looking for a formula something like this if(range = "criteria1" or "crtieria2" or "criteria3"), dothis ?

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Conditional Formatting

    Quote Originally Posted by sthiru View Post
    Thank you

    So only one rule for one color!

    And do you got any idea regarding criteria i.e. Looking for a formula something like this if(range = "criteria1" or "crtieria2" or "criteria3"), dothis ?
    1) Yes, one rule for one color

    2) Use :
    =OR(range="criteria1",range="criteria2",...)

  7. #7
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Re: Conditional Formatting

    Quote Originally Posted by bebo021999 View Post
    1) Yes, one rule for one color

    2) Use :
    =OR(range="criteria1",range="criteria2",...)
    Thank you but OR function is not working for Range!!!

    Thanks
    Thiru

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,461

    Re: Conditional Formatting

    Why not?

    Or try:

    =OR(range={"criteria1","criteria2"})

    If it does not work, try to upload a sample worksheet.

  9. #9
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Re: Conditional Formatting

    Quote Originally Posted by bebo021999 View Post
    Why not?

    Or try:

    =OR(range={"criteria1","criteria2"})

    If it does not work, try to upload a sample worksheet.
    No! it doesn't work - Here you go I have attached the sample filesample.xlsx

  10. #10
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Conditional Formatting

    "range" is just a placeholder for a real cell address like A1. This should work

    =or($a1="this",$a1="that",$a1="the other",$B1="this",$B1="that", ....etc)

    You need to be careful with the $ sign and truly understand how relative and absolute references work.

  11. #11
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Re: Conditional Formatting

    Quote Originally Posted by teylyn View Post
    "range" is just a placeholder for a real cell address like A1. This should work

    =or($a1="this",$a1="that",$a1="the other",$B1="this",$B1="that", ....etc)

    You need to be careful with the $ sign and truly understand how relative and absolute references work.
    Great guys teylyn and bebo021999 - Thank you very much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formatting Cells with Date or Text Values in a Conditional Formatting Formula
    By Phil Hageman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 09:36 AM
  2. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 AM
  3. Replies: 1
    Last Post: 09-20-2013, 06:23 PM
  4. Conditional Formatting via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  5. Delete Conditional Formatting conditions but keep cell formatting - Excel 2010
    By tetreama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 08:28 PM
  6. Replies: 3
    Last Post: 05-15-2012, 04:13 PM
  7. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 AM

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