+ Reply to Thread
Results 1 to 9 of 9

Conditional Formatting Based on Cell Values

  1. #1
    Forum Contributor
    Join Date
    12-24-2010
    Location
    South Africa
    MS-Off Ver
    Office 2003; Office 2007; Office 2010 (Prefered)
    Posts
    102

    Conditional Formatting Based on Cell Values

    Hi All,

    This is probably a pretty basic question, but for the life of me I can not remember how to correctly apply Conditional Formatting to a range of cells instead of applying it to each cell one at a time.

    I would like to apply conditional formatting to a number of cells based on a corresponding cell. i.e.

    If Cell A1 > B1 then Format Green, If Cell A1 < B1 then Format Red
    If Cell A2 > B2 then Format Green, If Cell A2 < B2 then Format Red

    I know I can do this by applying it to each cell one at a time, but this is quite time consuming over a large range of cells.

    Your help here is greatly appreciated, thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Conditional Formatting Based on Cell Values

    Select the whole range and use the formula for the first row. Make sure the row number is relative not absolute.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    12-24-2010
    Location
    South Africa
    MS-Off Ver
    Office 2003; Office 2007; Office 2010 (Prefered)
    Posts
    102

    Re: Conditional Formatting Based on Cell Values

    Thanks for the quick reply...

    Please let me know what I am doing wrong here? The value is being checked against J4 and not the value cell that is related to it.



    Conditional.jpg

    Thanks

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Conditional Formatting Based on Cell Values

    What have column H and cell J4 got to do with A1, A2, B1, B2, etc?

    In answer to that original question, you would select cells A1:An, where n is the last row of data. The formula would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    for green and a separate formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    for red.

  5. #5
    Forum Contributor
    Join Date
    12-24-2010
    Location
    South Africa
    MS-Off Ver
    Office 2003; Office 2007; Office 2010 (Prefered)
    Posts
    102

    Re: Conditional Formatting Based on Cell Values

    Apologies, I only used A & B as examples for purposes of the question.
    H & J are the actual columns I am working with. Will apply the solution provided and check it again.
    Thanks

  6. #6
    Forum Contributor
    Join Date
    12-24-2010
    Location
    South Africa
    MS-Off Ver
    Office 2003; Office 2007; Office 2010 (Prefered)
    Posts
    102

    Re: Conditional Formatting Based on Cell Values

    HI there,

    I tried the suggested, but I still don't get the desired result. I have only applied one formula thus far to check. See attached example

    Conditional2.jpg

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Conditional Formatting Based on Cell Values

    Remove the quotes from the formula.

  8. #8
    Forum Contributor
    Join Date
    12-24-2010
    Location
    South Africa
    MS-Off Ver
    Office 2003; Office 2007; Office 2010 (Prefered)
    Posts
    102

    Re: Conditional Formatting Based on Cell Values

    Perfect, thanks a million. I think I kept making the same error in my formula which is why I couldn't get it to work.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Conditional Formatting Based on Cell Values

    You're welcome. Thanks for the rep. And thanks for the feedback.

    Easy mistake to make. It often puts quotes in for less than obvious reasons and then you see what you expect to see.

+ 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. Please help: conditional formatting based on two cell values!
    By DanniMc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-12-2016, 01:57 PM
  2. Conditional Formatting based on 2 cell values
    By ksmith767 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-28-2014, 01:13 PM
  3. [SOLVED] Conditional formatting based on two cell values
    By Thinker8 in forum Excel General
    Replies: 7
    Last Post: 09-22-2013, 12:50 AM
  4. [SOLVED] Conditional Formatting Based on Values in another Cell
    By jdegeorge in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-12-2013, 02:35 PM
  5. Conditional Formatting based on cell values
    By nickbrandon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 08:26 AM
  6. Conditional Formatting based on several cell values
    By jpruffle in forum Excel General
    Replies: 3
    Last Post: 09-28-2009, 08:02 AM
  7. [SOLVED] conditional formatting based on values of another cell
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2005, 04:05 AM

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.6.0 RC 1