+ Reply to Thread
Results 1 to 6 of 6

Change cell color based on previous cell value (Increase/decrease)

  1. #1
    Registered User
    Join Date
    07-27-2020
    Location
    Alberta, Canada
    MS-Off Ver
    2010
    Posts
    2

    Change cell color based on previous cell value (Increase/decrease)

    Hello,

    I am looking for support to change a cell color based on whether or not it is an increase or decrease from the previous value.

    For example if A1 is "1" and I manually changed it to "2", A1 fill color would change to green (increase) and if A1 was manually changed to 0, the color would change to red (decrease).

    Thank you!

  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,751

    Re: Change cell color based on previous cell value (Increase/decrease)

    use a conditional format
    you could either select the range A1

    then use a formula

    =A1>A2
    format colour RED

    then a new rule for green
    A1<A2

    But what colour for =

    i'll edit and post a sample
    Attached Files Attached Files
    Last edited by etaf; 07-27-2020 at 04:48 PM.
    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
    07-27-2020
    Location
    Alberta, Canada
    MS-Off Ver
    2010
    Posts
    2

    Re: Change cell color based on previous cell value (Increase/decrease)

    Hi Wayne,

    Thank you for your reply. I am looking to change the value of A1 based on its previous value, rather than a different cell. I have not been able to identify a way to conditionally format a cell based on the same cell's previous values. I want the color of the cell to change based on an increase/decrease in value within the same cell rather than the value itself or any other cell value, if that makes sense?

  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,751

    Re: Change cell color based on previous cell value (Increase/decrease)

    sorry misunderstood m probably need vba to do that , not my expertise

  5. #5
    Registered User
    Join Date
    04-26-2020
    Location
    Massachusetts
    MS-Off Ver
    Office 365
    Posts
    93

    Re: Change cell color based on previous cell value (Increase/decrease)

    This method would require you adding a new column. Pass/Fail

    In this new column put the following formula for every row to be checked.
    IF(A2>1,"Fail","Pass") My example starts at A2 you want the first cell of your
    data.

    Click on "Conditional Formatting" and then "Highlight Cell Rules" and then
    "Text That Contains". A box will appear with The title "Highlight Cell Rules"

    First Selection Type Pass and change the drop down entry to "Green Fill with Dark
    Green Text" and then OK. Copy A2 and paste down the Pass/Fail Column.

    Then repeat the above changing "Pass" to "Fail" and select "Light red with dark
    red text" and then "OK" Copy A2 and paste down the Pass/Fail Column.

    I am attaching a file with some sample data.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-26-2020
    Location
    Massachusetts
    MS-Off Ver
    Office 365
    Posts
    93

    Re: Change cell color based on previous cell value (Increase/decrease)

    OK it can be done, but you must enter the formulas in A1 and when all formulas have been entered
    highlight A1 and use the "Fill Handle" to format the remaining cells.

    Look at the attached files "Conditional Formatting Rules.png" and
    "Change color.xlsx

    Any Value that you do not want colored just change the rule for that value.
    Use the PNG file to see how each value 0 through 3 will be formatted

    Select Conditional Formatting
    Select Highlight Cell Rules
    Select Equal To
    Dialog Box appears with Equal To title
    first enter "0" next enter ""Green Fill with Dark Green Text" next "OK" or select "Custom Format"
    Then select font and fill to your choosing" next "OK" and then "OK" again

    With mouse in A1
    Select Conditional Formatting
    Select Highlight Cell Rules
    Select Equal To
    Dialog Box appears with Equal To title
    first enter "1" next enter ""Green Fill with Dark Green Text" next "OK"

    With mouse in A1
    Select Conditional Formatting
    Select Highlight Cell Rules
    Select Equal To
    Dialog Box appears with Equal To title
    first enter "2" next enter ""Green Fill with Dark Green Text" next "OK" or select "Custom Format"
    Then select font and fill to your choosing" next "OK" and then "OK" again

    With mouse in A1
    Select Conditional Formatting
    Select Highlight Cell Rules
    Select Equal To
    Dialog Box appears with Equal To title
    first enter "3" next enter ""Light red with dark red text" next "OK"

    I am attaching a file with some sample data.
    Attached Images Attached Images
    Attached Files Attached Files

+ 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. [SOLVED] Change background color of cell if previous column cell value is different.
    By abhinavbinkar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2014, 08:25 AM
  2. Replies: 3
    Last Post: 12-16-2012, 12:49 PM
  3. Replies: 3
    Last Post: 09-18-2012, 01:01 AM
  4. [SOLVED] Cell color change if value is = or > or < compare with previous cell
    By cityguy10005 in forum Excel General
    Replies: 8
    Last Post: 07-29-2012, 07:52 PM
  5. how to increase/ decrease cell value incrementally?
    By naira in forum Excel General
    Replies: 2
    Last Post: 06-12-2012, 09:06 AM
  6. Adding the cell changes according to decrease or increase in a cell value.
    By Sarangsood in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-02-2012, 03:22 AM
  7. [SOLVED] How do I set a cell that can increase but never decrease?
    By Rich in forum Excel General
    Replies: 1
    Last Post: 11-02-2005, 06:17 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