Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
sweetsue516
 
Posts: n/a
Default Conditional formatting

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 =a6a8 for a formatting result of yellow background.

Is there a formula for when negative numbers will sometimes be involved?
  #2   Report Post  
swatsp0p
 
Posts: n/a
Default


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

  #3   Report Post  
David McRitchie
 
Posts: n/a
Default

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" wrote in message ...
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 =a6a8 for a formatting result of yellow background.

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



  #4   Report Post  
B. R.Ramachandran
 
Posts: n/a
Default

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting Error ddate Excel Worksheet Functions 0 May 5th 05 09:00 PM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
conditional formatting question Deb Excel Discussion (Misc queries) 0 March 23rd 05 02:07 AM
Determine cells that drive conditional formatting? Nicolle K. Excel Discussion (Misc queries) 2 January 7th 05 01:08 AM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


All times are GMT +1. The time now is 01:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"