• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Identically formatted cells behave differently

steviewade2000

New Member
I have two identical spreadsheets where cells behave differently even though they are identically formatted. Each contain the same formula where the result is $0. In one the value '-$0.00' appears whilst in the other '$ -' appears. In the case of the former the resultis not recognised as zero and this interferes with conditional formatting. I have checked there are no stray decimals.
 
Hi, steviewade2000!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about questions in general...


If you haven't performed yet the search herein, try going to the topmost right zone of this page (Custom Search), type the keywords used in Tags field when creating the topic or other proper words and press Search button. You'd retrieve many links from this website, like the following one(s) -if any posted below-, maybe you find useful information and even the solution. If not please advise so as people who read it could get back to you as soon as possible.


And about this question in particular...


I'd try this:

a) Select each cell, press Ctrl-1 and write down the whole format.

b) Select any unused and unformatted cell and type this formula: =<OriginalCell> and write down the values, for each cell.

c) select any unused and unformatted cel and type this formula: =<OriginalCell1>=<OriginalCell2> and write down the output.

d) Write all that here.


It's highly probable that the values differ due to different calculation processes. If so, consider uploading both sample files, it'd be very useful for those who read this and might be able to help you. Thank you. Give a look at the green sticky posts at this forums main page for uploading guidelines.


Regards!
 
Probably due to a floating point error. See http://blogs.office.com/b/microsoft-excel/archive/2008/04/10/understanding-floating-point-precision-aka-why-does-excel-give-me-seemingly-wrong-answers.aspx


Specifically this bit:

Correcting Precision Errors


Let us go back to my very first example where my conditional formatting seemingly did not work. I know now that was due to the fact that the numbers I was using to calculate the absolute difference did not have exact binary equivalents. This resulted in 1.3240 - 1.3190 = 0.0049999999999999.


There are two basic ways in which you can compensate for some of the errors due to floating point calculation. The first method is to use the ROUND() function. The ROUND() function can be used to round the numbers to the number of decimal places that is required in your calculations. For my absolute difference column, I only require 4 decimals of precision. So I change the formula in the absolute difference column from:


=ABS(A2-B2)


To:


=ROUND(ABS(A2-B2),4)


My conditional formatting rule works as expected now since 0.0049999999999999 has been rounded to 0.0050.


The second method to prevent rounding errors from affecting your work is by using the Precision as displayed option. This option forces the value of each number in the worksheet to be the displayed value. To turn on this option, follow these steps:


1. Click Microsoft Office Button -> Excel Options -> Advanced

2. In the When calculating this workbook section, select the workbook you want, and then select the Set precision as displayed check box.

3. Click OK.


Going back to my absolute difference example, I set the number format to show four decimal places, and then I turn on Precision as displayed option. Since the display value is the actual value in the cell now, my conditional formatting works properly!


It is important to note that once the workbook is saved, all accuracy beyond four decimal places will be lost. This option affects the active workbook including all worksheets. You cannot undo this option and recover the lost data so save your workbook prior to enabling this option. This option is generally not recommended unless you are sure more precision will not ever be needed for your situation.
 
Hi, steviewade2000!

A few days ago there's been a similar issue regarding rounding and inequalities. Maybe you want to give a look at it:

http://chandoo.org/forums/topic/vlookup-complications-percentages

Regards!
 
Back
Top