+ Reply to Thread
Results 1 to 5 of 5

Conditional Formatting help - based on difference between two cells

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Durham
    MS-Off Ver
    Excel 2010
    Posts
    10

    Conditional Formatting help - based on difference between two cells

    Hi,

    I need a formula to highlight a cells in a column based on the difference between two other cells from columns B and D.

    E.g. I want it to highlight a cell Green if the difference is 0, Yellow if the difference is 1, Red if the difference is 2 and Blue is the difference is more than 2.

    conditional formatting2.xlsx

    I have tried using this code but because I am not very good with excel, I am struggling to make it work.

    e.g. Highlight green if

    =MAX(b1,d1)-MIN(b1,d1)=2

    What code do I put in the box please?

    Joanne

  2. #2
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional Formatting help - based on difference between two cells

    Try

    =ABS($B2-$D2)=1

    =ABS($B2-$D2)=2

    =$b2=$d2
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    10-27-2012
    Location
    Durham
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Conditional Formatting help - based on difference between two cells

    Strangely, my old formula appears to be working! =MAX(b1,d1)-MIN(b1,d1)=2


  4. #4
    Forum Contributor
    Join Date
    01-11-2012
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: Conditional Formatting help - based on difference between two cells

    You can use up to 4 conditional formatting to meet your need. If you have a bunch of rows, you may want to ask for a VBA code to do the job. see the first row.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-27-2012
    Location
    Durham
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Conditional Formatting help - based on difference between two cells

    Thank you for taking the time to download and play with my file.

    It looks as though it could work. The only problem is, it is the column to the left that I want highlighting. 'End of Year Expectations'

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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