+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting - change colour based on a +/- %

  1. #1
    Registered User
    Join Date
    10-03-2009
    Location
    uk
    MS-Off Ver
    MS365 v, 2402.
    Posts
    11

    Conditional Formatting - change colour based on a +/- %

    Hi

    I want to change the colour of a cell based on the following conditions:-

    = A1 & B1 are the same = Green

    = A1 is within + or - 10% of B1 = Amber

    = A1 is greater than + or - 10% of B1 = Red

    I'm using Excel 2002 so I can only have 3 rules.

    Any ideas? I had a quick look at http://chandoo.org/wp/tag/conditional-formatting/ and I couldn't see anything...

  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 - change colour based on a +/- %

    Something like this?

    Book1.xls

    Actually you need 2 CF, not 3.
    Last edited by zbor; 10-03-2009 at 04:28 PM.

  3. #3
    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 - change colour based on a +/- %

    Hi, your three conditions can be

    1. Formula is
    =A1=B1

    2. Formula is
    =ABS((B1-A1)/B1)<=0.1

    3. Formula is
    =ABS((B1-A1)/B1)>0.1

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

    Re: Conditional Formatting - change colour based on a +/- %

    No need for 3 CF and slowing down workbook. 2 are enough:

    1. CF - green when equal
    2. CF - yellow when <=+-10%
    3. no CF - red, everything else

    Just example, any other combination can be made

  5. #5
    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 - change colour based on a +/- %

    @zbor: The OP is after a solution that looks if the numbers are within 10% of each other. Your solution is based on a difference of 10 between the two instead.

    So, A=1000 and B=1020 should be amber, because the difference is less than 10%, but your solution shows it red because it's more than 10.

    Slight difference.

    zbor is right with regards to the two conditions only, though. If your default color for the range is green, then you only need to define the rules for amber and red.

    cheers

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

    Re: Conditional Formatting - change colour based on a +/- %

    Yes, I saw it and modified with your solution

+ 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