PC Review


Reply
Thread Tools Rate Thread

11-Place Decimal?

 
 
Rodan
Guest
Posts: n/a
 
      23rd May 2011
Excel 2007 When subtracting 2-place (dollar)
amounts in a row, the difference is shown as an
unrounded 11-place decimal. Trying to format the
difference cell in that row to a 2-place presentation
has no effect. What am I missing ?

Thanks,

Rodan.
 
Reply With Quote
 
 
 
 
GS
Guest
Posts: n/a
 
      23rd May 2011
on 5/23/2011, Rodan supposed :
> Excel 2007 When subtracting 2-place (dollar)
> amounts in a row, the difference is shown as an
> unrounded 11-place decimal. Trying to format the
> difference cell in that row to a 2-place presentation
> has no effect. What am I missing ?
>
> Thanks,
>
> Rodan.


Try using the ROUND() function, and specify the desired decimal place
precision.

Example:

=ROUND(A1-B1, 2)

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      24th May 2011
On May 23, 11:24*am, "Rodan" <Ro...@Verizon.NOT> wrote:
> When subtracting 2-place (dollar) amounts in a row,
> the difference is shown as an unrounded 11-place decimal.
> Trying to format the difference cell in that row to a
> 2-place presentation has no effect. *What am I missing ?


Nothing. This is a very common problem. For example, note that
=IF(10.1 - 10 = 0.1,TRUE) returns FALSE(!).

In general, one remedy is to explicitly round expressions that you
expect to be accurate to a specified precision. In my example,
=IF(ROUND(10.1-10,1)=0.1,TRUE) returns TRUE.

Changing the format alone usually only alters the __appearance__ of
values, not the __actual__ value itself. For example, if you enter
1.25 into A1 and format to display 1 decimal place, it will usually
__appear__ to be 1.3, but only =IF(A1=1.25,TRUE) returns TRUE.

I say "usually" because there is an alternative to using ROUND
explicitly pervasively: setting the "Precision as displayed"
calculation option (PAD).

However, I do not recommend PAD. First, it can change constants
irreparably if you are not careful to set cell formats before setting
PAD and before entering constants. Second, PAD is not a cure-all
because it performs its function only on the final result of a
formula. For example, setting PAD does not avoid the need for ROUND
if the 10.1-10 example above.

The root cause of the problem is: Excel, like most applications, uses
binary floating-point to represent numbers. Consequently, most non-
integers (as well as integers larger than 2^53) cannot be represented
exactly. Arithmetic operations exacerbate the problem.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal Place MShami Microsoft Access Forms 1 18th Aug 2009 12:29 PM
Text box formatted to General Number with 2 decimal places NOTallowing the decimal place. p-rat Microsoft Access Form Coding 3 14th Jan 2008 05:20 PM
Subtracting two 2-decimal place numbers gives result 13-decimal places? tsdutcher@earthlink.net Microsoft Excel Worksheet Functions 5 12th Mar 2007 10:38 PM
Converting 2-place decimal value to floating point decimal number with leading zero Kermit Piper Microsoft Excel Misc 3 18th Mar 2006 06:20 PM
calculate 1 Decimal place but show 2 decimal places =?Utf-8?B?RGFyeWw=?= Microsoft Access Reports 2 13th Mar 2004 01:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:16 PM.