+ Reply to Thread
Results 1 to 8 of 8

Thread: Greater and less than

  1. #1
    Registered User
    Join Date
    02-27-2011
    Location
    Nottingham England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Greater and less than

    Hi, I am wanting to format Cell C to be coloured green when Cell A - Cell B lies between -2 and 2 , hope someone can help.TIA
    Last edited by derekfarr; 03-11-2011 at 05:05 AM.

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Greater and less than

    Assuming we're talking about C1 ... with C1 the active cell apply a Conditional Format FormulaIs rule of:

    =ABS($A1-$B1)<=2
    format Green

  3. #3
    Registered User
    Join Date
    02-10-2011
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Greater and less than

    You can also do this:

    Activate the cell in question
    Open format cell
    Choose tab Number
    Choose Category Custom
    Put the text below in as Type
    [Black][<=-2]-0.00;[Black][>=2]0.00;[Green]0.00
    Now you can drag the formula and the format will follow.

  4. #4
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Greater and less than

    That's true if

    a) C actually contains =A-B (unspecified)

    b) You wish to format the Font rather than Interior Fill

  5. #5
    Registered User
    Join Date
    02-10-2011
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Greater and less than

    Right. But I have a question. I tried to copy exactly what you wrote in your first reply into cell c1 and got and error. Does it only work in 2010 (I use 2007) or what are I doing wrong.

  6. #6
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Greater and less than

    The formula posted is not to be placed in C1 rather it is for a Conditional Format rule.
    (if placed directly in C1 the formula would return either TRUE or FALSE - assuming both A1 & B1 are numbers/blank of course)

  7. #7
    Registered User
    Join Date
    02-10-2011
    Location
    Denmark
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Greater and less than

    Sorry for my stupidity, i have not used Conditional Format FormulaIs before.

  8. #8
    Registered User
    Join Date
    02-27-2011
    Location
    Nottingham England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Greater and less than

    Thanks Donkey it worked a treat

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