+ Reply to Thread
Results 1 to 7 of 7

Conditioning format based on adjacent cell

  1. #1
    Registered User
    Join Date
    08-19-2013
    Location
    Hong Kong, China
    MS-Off Ver
    Excel 2013
    Posts
    16

    Conditioning format based on adjacent cell

    Hi all:
    I have a similar problem on conditioning format.
    How would I make cells in column A to C be highlighted yellow, of which is 0.02 in value be higher than in compared with the adjacent cell in column D ?
    It is easy to use condition format function to setup the conditions in 1 row. The problem is there are thousands rows in the sheet(of which represents an individual file by each row), and need to have the conditioning format applied on each row independently. How can it be done w/o the need to have format painter applied line by line, of which is a very time consuming.

    Thanks so much
    sample.xlsx

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditioning format based on adjacent cell

    Hi and welcome to the forum

    1. highlight the range you want to apply the conditional formatting to (in your sample A3:C11)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter ==OR(A3-$D3>0.02,$D3-A3>0.02) format fill color as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditioning format based on adjacent cell

    self-deleted duplicate post
    Last edited by FDibbins; 08-19-2013 at 03:09 PM.

  4. #4
    Registered User
    Join Date
    08-19-2013
    Location
    Hong Kong, China
    MS-Off Ver
    Excel 2013
    Posts
    16

    Re: Conditioning format based on adjacent cell

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    1. highlight the range you want to apply the conditional formatting to (in your sample A3:C11)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter ==OR(A3-$D3>0.02,$D3-A3>0.02) format fill color as needed
    Sincere thank for your prompt reply.

    I try with your suggestion with the table resulted as and compare the table I define the CF using HL cells rule on the first row, then apply format painter line by line on the rest of the lines . Obviously the results displayed are quite different from these 2 methods. In fact the table appeared under the HL cell rules....format painter line by line is what I need. What can we do further?

    Many thanks all people.

    sample 1.xlsx

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditioning format based on adjacent cell

    If you compare the number of Conditional Formatting rules in Sample 1 to Sample 2 that I have uploaded you will notice a huge difference in the number of rules.

    The reason that the first set of Conditional Formatting rules differs from the second in Sample 1 is in the formula for the formatting and how it is applied. A completely different but reasonable interpretation of your requirements was given you by FDibbins. That is why his results are so different.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Registered User
    Join Date
    08-19-2013
    Location
    Hong Kong, China
    MS-Off Ver
    Excel 2013
    Posts
    16

    Re: Conditioning format based on adjacent cell

    You two gentlemen are so generous.
    Thanks for FDibbins's bright idea, and newdoverman's patient analysis and explanation.
    My problem is perfectly tackled.

    Sincerely thanks for both.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditioning format based on adjacent cell

    Thank you for your feedback. Helping, is what these forums are all about.

+ 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. Format cell based on adjacent cell / apply to column
    By mknispel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2013, 11:29 AM
  2. [SOLVED] Condtionally format an entire row based on adjacent cell values
    By Martinp217 in forum Excel General
    Replies: 8
    Last Post: 05-24-2013, 01:54 PM
  3. Macro that will clear contents of cell based on format of text in adjacent cell
    By judasdac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2012, 01:56 AM
  4. Replies: 1
    Last Post: 04-26-2010, 04:53 AM
  5. Format cell based on adjacent cells values
    By the majestic ferny in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2005, 02:35 PM

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