+ Reply to Thread
Results 1 to 4 of 4

Conditional formatting-Is there a formula for when negative numbers will sometimes be

  1. #1
    sweetsue516
    Guest

    Conditional formatting-Is there a formula for when negative numbers will sometimes be

    Trying to compare to numbers, some are negative. The cells contain formulas
    so I am using formulas verses cell values for comparision.

    The problem I am having is when the numbers are negative. We are comparing
    a loss of -4.39 (cell a6) which is better and the one we want the format
    applied to, than -4.72 (cell a8) but since these numbers are only sometimes
    negative the forumla is =a6>a8 for a formatting result of yellow background.

    Is there a formula for when negative numbers will sometimes be involved?

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    Try squaring the numbers before comparing them. This will eliminate the negative issue, assuming you want the value closest to zero.

    =a6^2<a8^2 should meet your needs regardless of positive or negative values.
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    David McRitchie
    Guest

    re: Conditional formatting-Is there a formula for when negative numbers will sometimes be

    Verify that you do in fact have numbers.

    =ISNUMBER(a1)

    --
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "sweetsue516" <[email protected]> wrote in message news:[email protected]...
    > Trying to compare to numbers, some are negative. The cells contain formulas
    > so I am using formulas verses cell values for comparision.
    >
    > The problem I am having is when the numbers are negative. We are comparing
    > a loss of -4.39 (cell a6) which is better and the one we want the format
    > applied to, than -4.72 (cell a8) but since these numbers are only sometimes
    > negative the forumla is =a6>a8 for a formatting result of yellow background.
    >
    > Is there a formula for when negative numbers will sometimes be involved?




  4. #4
    B. R.Ramachandran
    Guest

    re: Conditional formatting-Is there a formula for when negative numbers will sometimes be

    Comparing squares will fail if the two numbers being compared are equal in
    magnitude by opposite in sign. (eg., a6=-4.39, and a8=4.39, or vice versa).

    Direct comparison SHOULD work regardless of their sign. Of course, as David
    McRitchie remarked, the values should be formatted as numbers, not strings.

    B.R.Ramachandran

    "swatsp0p" wrote:

    >
    > Try squaring the numbers before comparing them. This will eliminate the
    > negative issue, assuming you want the value closest to zero.
    >
    > =a6^2<a8^2 should meet your needs regardless of positive or negative
    > values.
    >
    >
    > --
    > swatsp0p
    >
    >
    > ------------------------------------------------------------------------
    > swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
    > View this thread: http://www.excelforum.com/showthread...hreadid=399121
    >
    >


+ 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