+ Reply to Thread
Results 1 to 3 of 3

Plus/Minus Function

Hybrid View

  1. #1
    Registered User
    Join Date
    06-10-2009
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Plus/Minus Function

    Hello, I'm trying to create a formula where I can compare two cells but accept them as equal is one is plus/minus 0.1.
    Example:
    Cell A1 is 3, Cell A2 is 3.2, I want Cell A3 to turn red (or report "1")
    Cell A1 is 3, Cell A2 is 3.1, I want Cell A3 to turn green (or report "0")

    I'm hoping this is an easy one.

    Thanks,
    Tim
    Last edited by TimmyK; 06-10-2009 at 12:56 PM.

  2. #2
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Plus/Minus Function

    Quote Originally Posted by TimmyK View Post
    Hello, I'm trying to create a formula where I can compare two cells but accept them as equal is one is plus/minus 0.1.
    Example:
    Cell A1 is 3, Cell A2 is 3.2, I want Cell A3 to turn red (or report "1")
    Cell A1 is 3, Cell A2 is 3.1, I want Cell A3 to turn green (or report "0")

    I'm hoping this is an easy one.

    Thanks,
    Tim
    =--not(AND((a1+0.1)>=a2,(a1-0.1)<=a2))

    or in conditional formatting

    formula is
    =AND((a1+0.1)>=a2,(a1-0.1)<=a2) for green

    =not(AND((a1+0.1)>=a2,(a1-0.1)<=a2)) for red
    Attached Files Attached Files
    Last edited by squiggler47; 06-10-2009 at 11:50 AM. Reason: Added attachment
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Plus/Minus Function

    Select A3 and go to Format|Conditional Formatting

    Select Formula Is and enter formula: =ABS(A2-A1)<=0.1

    Click Format and pick green from pattern tab

    Click Ok.

    Click Add

    Select Formula Is and enter formula: =ABS(A2-A1)>0.1

    Click Format and pick red from pattern tab

    Click Ok
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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