#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default rounding error?

A1 = 5.0568725
B1 = 5.0569
C1 = Round(A1,4)-B1

Why doesn't C1 give me a zero value?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default rounding error?

Regardless of how the cell has been formatted, cell A1 still contains the
value of 5.0568725. To get a zero you would have to round the number in cell
A1 to 4 decimal positions"

=ROUND(5.0568725,4)


--
Kevin Backmann


"Steve" wrote:

A1 = 5.0568725
B1 = 5.0569
C1 = Round(A1,4)-B1

Why doesn't C1 give me a zero value?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default rounding error?

Go to format cell | number | category | number | decimal places 0 | ok




On May 30, 8:19*pm, Steve wrote:
A1 = 5.0568725
B1 = 5.0569
C1 = Round(A1,4)-B1

Why doesn't C1 give me a zero value? *


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,814
Default rounding error?

In my C1 formula why doesn't "round(a1,4)" calculate a value of 5.0569 so
when I subtract 5.0569 I get zero?

"Kevin B" wrote:

Regardless of how the cell has been formatted, cell A1 still contains the
value of 5.0568725. To get a zero you would have to round the number in cell
A1 to 4 decimal positions"

=ROUND(5.0568725,4)


--
Kevin Backmann


"Steve" wrote:

A1 = 5.0568725
B1 = 5.0569
C1 = Round(A1,4)-B1

Why doesn't C1 give me a zero value?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default rounding error?

Initially I overlooked your formula when I responded the first time but I've
not been able to replicate your answer. I'm using Excel 2003 and regardless
of where I do the rounding I'm getting 0
--
Kevin Backmann


"Steve" wrote:

In my C1 formula why doesn't "round(a1,4)" calculate a value of 5.0569 so
when I subtract 5.0569 I get zero?

"Kevin B" wrote:

Regardless of how the cell has been formatted, cell A1 still contains the
value of 5.0568725. To get a zero you would have to round the number in cell
A1 to 4 decimal positions"

=ROUND(5.0568725,4)


--
Kevin Backmann


"Steve" wrote:

A1 = 5.0568725
B1 = 5.0569
C1 = Round(A1,4)-B1

Why doesn't C1 give me a zero value?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default rounding error?

My guess is that B1 is the result of a calculation an that =(B1-5.0569) is
not zero.

Computers do finite precision math, so rounding errors can accumulate.
Consequently, with floating point values you should test whether
ABS(x-y)<epsilon, instead of whether x=y.

"Steve" wrote:

A1 = 5.0568725
B1 = 5.0569
C1 = Round(A1,4)-B1

Why doesn't C1 give me a zero value?

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
Rounding error is conditional on brackets JasonG Excel Discussion (Misc queries) 2 February 4th 08 05:31 PM
Have Excel display an error rather than rounding # to fit column Frank Setting up and Configuration of Excel 1 July 25th 06 06:35 PM
Rounding Error when adding or subtracting two cells mtheo Excel Worksheet Functions 2 February 28th 06 06:51 PM
how to minimize rounding error with complicated formulas Erick T. Excel Discussion (Misc queries) 1 January 25th 06 02:05 PM
Percentage rounding error in charts Tracey Excel Discussion (Misc queries) 4 May 14th 05 04:01 AM


All times are GMT +1. The time now is 03:00 PM.

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"