+ Reply to Thread
Results 1 to 5 of 5

Formula to colour in cells depending upon the relationship of 2 other cells

  1. #1
    Registered User
    Join Date
    09-24-2013
    Location
    Bedford
    MS-Off Ver
    Excel 2010
    Posts
    10

    Formula to colour in cells depending upon the relationship of 2 other cells

    I am trying to automate a process where I have to colour in cells depending upon the relationship of a result figure to a target and depending upon the aim.

    The three colours are:
    Green - where the result is better than the target
    Amber - Where the result although worse than the target is within 10%
    Red - Where the result worse than the target and outside the 10% (More than 10%)

    The target may be greater than or less than depending upon the aim.

    I have been given a formula, which is in the attached sheet and which works for some of the 12 different scenarios but not others. I'd be very grateful for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    you need to be consistent in using % or numbers as 100%=1
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-24-2013
    Location
    Bedford
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    Quote Originally Posted by martindwilson View Post
    you need to be consistent in using % or numbers as 100%=1
    I have no choice some of the measures are % some are numbers, I dont mind having a different formula if its a % or a number or 4 different formulas depending upon the numeral, % and aim. But you will see that the formula I currently have is giving a range of answers

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    the 3 rules would be
    =B2<C2 green
    =AND(B2>C2,B2<=C2+0.1*C2) amber
    =AND(B2>C2,B2>C2+C2*0.1) red
    (it doesn't matter if they are whole numbers or percentages after all )

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    tidied up a bit

    =B2<C2 green
    =AND(B2>C2,B2<=C2*1.1) amber
    =B2>C2*1.1 red

  6. #6
    Registered User
    Join Date
    09-24-2013
    Location
    Bedford
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    Thank you but I have tried these and they dont do anything. It just says its an error

  7. #7
    Registered User
    Join Date
    09-24-2013
    Location
    Bedford
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    I just want a formula that says if Cell X is less than Cell Y then its Green or if Cell X is up to 10% more than Cell Y its Amber or if Cell X 11% or more than Cell Y = Red.

    Then I need to be able to reverse that formula to say Cell X is more than Cell Y then its Green or if Cell X is up to 10% less than Cell Y its Amber or if Cell X 11% or less than Cell Y = Red.

  8. #8
    Registered User
    Join Date
    09-24-2013
    Location
    Bedford
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    I just want a formula that says if Cell X is less than Cell Y then its Green or if Cell X is up to 10% more than Cell Y its Amber or if Cell X 11% or more than Cell Y = Red.

    Then I need to be able to reverse that formula to say Cell X is more than Cell Y then its Green or if Cell X is up to 10% less than Cell Y its Amber or if Cell X 11% or less than Cell Y = Red.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to colour in cells depending upon the relationship of 2 other cells

    error where does it say error? if you want to colour the cells then use cf
    if you just want words then see column d
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-12-2004
    Location
    Harpenden
    Posts
    18

    Red face Re: Formula to colour in cells depending upon the relationship of 2 other cells

    Thanks very much that's great, very helpful.

+ 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. Fill cells depending on colour?
    By Mattneedshelp in forum Excel General
    Replies: 1
    Last Post: 04-23-2012, 11:00 AM
  2. Replies: 2
    Last Post: 04-05-2012, 08:22 AM
  3. How to change a cell colour depending an a different cells value?
    By abb16ott in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-23-2009, 04:05 AM
  4. Changing cell colour depending on another cells value...
    By Web master in forum Excel General
    Replies: 3
    Last Post: 01-10-2006, 08:35 AM
  5. [SOLVED] Changing cell colour depending on another cells value...
    By Web master in forum Excel General
    Replies: 3
    Last Post: 01-10-2006, 08:35 AM

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