+ Reply to Thread
Results 1 to 8 of 8

changing cell color based on value of another cell?

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    oklahoma city, oklahoma
    MS-Off Ver
    365 VERSION 2309?
    Posts
    42

    changing cell color based on value of another cell?

    need to change "fill" color of cell based on value of another cell:

    doing work order reviews via spreadsheet,
    have a column (a) of scheduled hours and a column of actual hours (b)
    column (c) divides a/b and reports as a "percentage"

    based on that value, in another column (d),
    i need to change the fill color based on percentage ...
    red for any below 90%
    yellow for any above 110%
    green for any 90%-110%

    is this doable in a simple formula?

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,795

    Re: changing cell color based on value of another cell?

    conditional formatting should do this for you

    it would be better with a sample spreadsheet - let me see meanwhile

    fill what cells

    for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
    Conditional Formatting

    Highlight applicable range >>
    select the range you want to fill- lets say column C c2:c100 - Change, reduce or extend the rows to meet your data range of rows

    Home Tab >> Styles >> Conditional Formatting
    New Rule >> Use a formula to determine which cells to format
    Edit the Rule Description: Format values where this formula is true:
    =AND($D2<0.9,$D2<>"")

    Format [Number, Font, Border, Fill]
    choose the format you would like to apply when the condition is true
    OK >> OK

    New rule and use
    =$D2>1.1

    new rule
    =$D2>=0.9

    put in that order
    use stop if true and then should be OK, otherwise the >0.9 will overwrite the >1.1

    but what colour if it equals the values
    0.9 , 1.1
    Attached Files Attached Files
    Last edited by etaf; 09-23-2023 at 10:14 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    11-07-2012
    Location
    oklahoma city, oklahoma
    MS-Off Ver
    365 VERSION 2309?
    Posts
    42

    Re: changing cell color based on value of another cell?

    Forgot to attach file
    Attached Files Attached Files

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,795

    Re: changing cell color based on value of another cell?

    you need to explain a little more
    is it columns I and M you want to colour
    you said not clear now on what column the % you want to test is in
    C is a description now and not
    column (c) divides a/b and reports as a "percentage"
    and
    based on that value, in another column (d),
    D = routing and not a %

    so i think a fuller explanation is required
    BUT
    the formulas still apply - select the range you want to colour and use the formulas as i posted - just change the column from D to whatever % column you are testing

  5. #5
    Registered User
    Join Date
    11-07-2012
    Location
    oklahoma city, oklahoma
    MS-Off Ver
    365 VERSION 2309?
    Posts
    42

    Re: changing cell color based on value of another cell?

    Sorry, the a,b,c ref was just an example.
    in the attached file, i need the value in column F to be displayed by color in column I

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,795

    Re: changing cell color based on value of another cell?

    ok,
    i applied 3 rules - and selected F5 to F40 - you can extend the rows to 100 , 1000 whatever , as i test each cell for a number
    but as we dont want to highlight the titles/text or blank cells i have used
    RED
    =AND(ISNUMBER($F5),$F5<>"",$F5<0.9)

    it checks to see if F5 and then each cell to F40 to see if it is a number -
    then if F5 to F40 cell is not blank
    and then to colour RED if the cell is below 90%

    YELLOW
    =AND(ISNUMBER($F5),$F5<>"",$F5>1.1)

    GREEN
    =AND(ISNUMBER($F5),$F5<>"",$F5>=0.9)

    and put in that order and used stop if true
    so if its over 110% it will be yellow and stop - otherwise it would be green as i just say >-90% so anythign over 110% would also be green if tht was allowed to test - but the order of yellow 1st and stop if true prevent that
    but we could add another and value for green
    =AND(ISNUMBER($F5),$F5<>"",$F5>=0.9, $F5<=1.1)

    AS i have selected the range starting at row 5 - then the formula also has to start at row 5
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-07-2012
    Location
    oklahoma city, oklahoma
    MS-Off Ver
    365 VERSION 2309?
    Posts
    42

    Re: changing cell color based on value of another cell?

    THANK YOU SO MUCH!

    i hate asking for things like this ...
    I am a 30+ year autocad user but a low frequency excel user but get cast into the role often

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,795

    Re: changing cell color based on value of another cell?

    you are welcome,
    i hate asking for things like this ...
    no problem thats what the forums are for , any questions.....
    but get cast into the role often
    I was a electronic/computer engineer and looked after the companies stats field service system and then i got asked about some of the KPI's and reports it produced, that was in 1982, and then had to use lotus 123 for those reports and started helping out and that sort of defined my career into KPI. performance , MI , change management , Business planning , luckily the company (DEC) did invest in training and obtaining professional qualifications in those days, including SQL, Excel, Access and various change/facilitation and management training etc etc
    Last edited by etaf; 09-23-2023 at 12:06 PM.

+ 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. Replies: 2
    Last Post: 10-11-2021, 08:58 AM
  2. [SOLVED] Changing fill color of shapes based on changing cell value
    By Stefan1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2012, 10:33 AM
  3. Replies: 2
    Last Post: 01-27-2012, 09:40 PM
  4. macro: changing cell color based on date in cell
    By mikewg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-27-2011, 02:17 AM
  5. macro: changing cell color based on date in cell
    By CindyG in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-13-2009, 12:10 PM
  6. macro: changing cell color based on count in cell
    By Vbort44 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2008, 07:28 PM
  7. Replies: 4
    Last Post: 12-14-2007, 05:39 PM

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