+ Reply to Thread
Results 1 to 10 of 10

Thread: how to change the color of a cell if the value of it is greater than another cell

  1. #1
    Registered User
    Join Date
    11-23-2011
    Location
    qatar
    MS-Off Ver
    Excel 2003
    Posts
    11

    how to change the color of a cell if the value of it is greater than another cell

    i have two column..for ex.
    original_value modified_val..
    2 2
    2 3 so if modified_val is greater than original_val the cell should become red color...and this rule should be applied to all rows coming under this column...
    using condition formatting i have to do separately for each cell..it's difficult as more than 500 columns are to be entered..

  2. #2
    Valued Forum Contributor
    Join Date
    05-18-2009
    Location
    Slo
    MS-Off Ver
    Excel 2007
    Posts
    210

    Re: how to change the color of a cell if the value of it is greater than another cell

    hi

    Here is what I'm using:
    Say ur Mofidied_value is Colum G and original_Value is Colum F
    =IF($F2="";"";AND($F2<$G2))
    This you would have to enter under Data/Conditional Formatting/New Condition

    And then you select the last part where it says Use a Formula to make a condition

    And you have to set the condiriton that the condition is for say $G$2:$G$200

  3. #3
    Valued Forum Contributor
    Join Date
    05-18-2009
    Location
    Slo
    MS-Off Ver
    Excel 2007
    Posts
    210

    Re: how to change the color of a cell if the value of it is greater than another cell

    What this formula does it check if Original_value has a value - if it doesn't it doesn't color the Modified_Value
    But if Original_Value isn't empty then it checks if Modified_Value is grater then Original_Value if the Modified_Value is biger it colors it red.
    You have to set the color to red in the Conditional formatting options.

  4. #4
    Registered User
    Join Date
    11-23-2011
    Location
    qatar
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: how to change the color of a cell if the value of it is greater than another cell

    Quote Originally Posted by stojko89 View Post
    hi

    Here is what I'm using:
    Say ur Mofidied_value is Colum G and original_Value is Colum F
    =IF($F2="";"";AND($F2<$G2))
    This you would have to enter under Data/Conditional Formatting/New Condition

    And then you select the last part where it says Use a Formula to make a condition

    And you have to set the condiriton that the condition is for say $G$2:$G$200
    i am using excel 2007...original_val is starting from F9 and modified_cal is from K9...i applied your code in New Formating Rule->Format values where this formula is true..but it says the code is wrong and where i have to use this code G$2:$G$200(k2:k200)

  5. #5
    Valued Forum Contributor
    Join Date
    05-18-2009
    Location
    Slo
    MS-Off Ver
    Excel 2007
    Posts
    210

    Re: how to change the color of a cell if the value of it is greater than another cell

    But it works?

  6. #6
    Registered User
    Join Date
    11-23-2011
    Location
    qatar
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: how to change the color of a cell if the value of it is greater than another cell

    Quote Originally Posted by stojko89 View Post
    But it works?
    no it shows error..can you elaborate it once more

  7. #7
    Valued Forum Contributor
    Join Date
    05-18-2009
    Location
    Slo
    MS-Off Ver
    Excel 2007
    Posts
    210

    Re: how to change the color of a cell if the value of it is greater than another cell

    Ok so I guess not.
    I've left out this part of code:

    IF($A2="";""...)
    The code works now as you said. You can see it under Data/Conditional Formatting.

    Check the workbook I've uploaded.

    You just need to fix it so it your workbook so it works for the range you want it to.
    Attached Files Attached Files

  8. #8
    Forum Guru ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    traded up
    MS-Off Ver
    2003 & 2010
    Posts
    1,905

    Re: how to change the color of a cell if the value of it is greater than another cell

    suhailtholakkal,

    Don't quote whole posts -- it's just clutter.

    If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
    “To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln

  9. #9
    Registered User
    Join Date
    11-23-2011
    Location
    qatar
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: how to change the color of a cell if the value of it is greater than another cell

    Thanks a lot stojko89...i have successfully solved this issue by following your instructions..so many Thanks for you and the Excel Forum for giving such an environment ..and i am sorry for quoting all post as i am new in such type of forum...

  10. #10
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel 2007
    Posts
    825

    Re: how to change the color of a cell if the value of it is greater than another cell

    hi
    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    Regards, John

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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.2.0