+ Reply to Thread
Results 1 to 8 of 8

Conditional formatting based on multiple rules

  1. #1
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Conditional formatting based on multiple rules

    I have always worked with conditional formatting on a basic basis. However, I'm trying to work with more advanced rules and I'm having trouble definining how I should approach it.

    Currently on my spreadsheet I have conditional formatting on B18, which is dependent on a tier - 1-5 which is calculated in cell E20.

    So,

    if E20 = 5 then condition formatting B18 0-104% = green, 104-105% = yellow, 105+ red
    if E20 = 4 then condition formatting B18 0-119% = green, 119-120% = yellow, 120+ red
    if E20 = 3 then condition formatting B18 0-124% = green, 124-125% = yellow, 125+ red
    if E20 = 2 then condition formatting B18 0-129% = green, 129-130% = yellow, 130+ red
    if E20 = 1 then condition formatting B18 0-134% = green, 134-135% = yellow, 135+ red

    I really don't know how to set conditional formatting arrays, how exactly can I do this, I assume it has to be done with formulas, and not the conditional formatting GUI. Or does this need to be done in VBA? I really appreciate any help, I'm a little out of my experience here.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Conditional formatting based on multiple rules

    What version of excel do you use?

    (Would be also nice to write it in profile)

  3. #3
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: Conditional formatting based on multiple rules

    Quote Originally Posted by zbor View Post
    What version of excel do you use?

    (Would be also nice to write it in profile)
    Ah, that's a good idea. I use Office 2007, however the spreadsheet is viewed by older versions, so I have to convert to compatibility back to 97 (which makes this really frustrating). However, this particular spreadsheet will only be viewed by users with office 2007, so I think I'll be okay without the compability.
    Last edited by Pyrex238; 05-05-2011 at 11:35 AM.

  4. #4
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: Conditional formatting based on multiple rules

    After searching the net, It seems I probably need to address this with VBA... could anyone confirm that's probably the best method?
    Last edited by Pyrex238; 05-05-2011 at 11:58 AM.

  5. #5
    Registered User
    Join Date
    05-05-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Conditional formatting based on multiple rules

    Hi Pyrex238, I will try my best here because I am only on my tablepc without Excel. As far as I could understand the 1-5 tier values are on E20 and the % on B18, right? If so, please use formulas on the conditional formatting with the following (and in the order as shown below):

    1) GREEN
    Formula: =(B18<(114+((5-E20)*5)-INT(5/E20)*10)

    2) YELLOW
    Formula: =(B18=<(115+((5-E20)*5)-INT(5/E20)*10)

    3) RED
    Formula: =(B18=(115+((5-E20)*5)-INT(5/E20)*10)

    In case the condition for the tier 5 is 114 instead of 104 (just wondering, because the difference between each tear was 5, but from tier #5 to #4 is 15) then please delete the INT(5/E20)*10 part.

    One thing I am not very sure now is about the % value on the conditional formatting. In case the formulas above does not work try dividing all numbers by 100.

    Try that and let me know in case of any issue. Tomorrow I will be back with my computer and can try before suggesting.

    Good luck

  6. #6
    Registered User
    Join Date
    05-05-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Conditional formatting based on multiple rules

    Sorry, on the last formula (for the red guys) please change B18= to B18>

  7. #7
    Registered User
    Join Date
    05-05-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Conditional formatting based on multiple rules

    Sorry again
    But replace INT(5/E20) by INT(E20/5). That will make it equal to 1 in case the tier is 5 and zero for the others.
    Next time I will wait to test on Excel before posting

  8. #8
    Registered User
    Join Date
    05-05-2011
    Location
    Belgium
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Conditional formatting based on multiple rules

    Pyrex238, after finally testing in my Excel, here are my final suggestions -- I hope

    Option #1
    GREEN: =(B18<=(1.14+((5-E20)*0.05)-INT(E20/5)*0.1))
    YELLOW: =(B18<=(1.15+((5-E20)*0.05)-INT(E20/5)*0.1))
    RED: =(B18>(1.15+((5-E20)*0.05)-INT(E20/5)*0.1))

    Option #2
    GREEN: =(B19<=(1.04+CHOOSE(E20,0.3,0.25,0.2,0.15,0)))
    YELLOW: =(B19<=(1.05+CHOOSE(E20,0.3,0.25,0.2,0.15,0)))
    RED: =(B19>(1.05+CHOOSE(E20,0.3,0.25,0.2,0.15,0)))

    Good luck

+ 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