C
Corundum
I recently became aware that Excel does not calculate values exactly bu
only approximates the mathemetical value of equations. I needed t
develop a spreadsheet that tested if an experimental value was withi
certain limits and found that Excel frequently gave misleading result
due to the error in the approximations it was computing. I onl
discovered the source of the bug after expanding the calculated result
to their full decimal place as illustrated below:
Column B subtracted from Column A should always be 0.0616
A B A-B
1.0616 1 0.061600000000000100000000000000
2.0616 2 0.061599999999999900000000000000
3.0616 3 0.061599999999999900000000000000
4.0616 4 0.061600000000000300000000000000
5.0616 5 0.061600000000000300000000000000
6.0616 6 0.061600000000000300000000000000
7.0616 7 0.061600000000000300000000000000
8.0616 8 0.061600000000000300000000000000
9.0616 9 0.061600000000000300000000000000
10.0616 10 0.061600000000000300000000000000
when using the formula:
= if( (A-B)>= 0.0616, "PASS" , "FAIL" )
Values for B = 2 and 3 give erroneous results (as well as othe
combinations yielding 0.0616) .
I fixed the bug by adding a round() function to the equation but wa
disturbed by the inacuracy of Excel's calculations, even though i
occurs at 10 to the minus 16 decimal place.
Does anyone know how to better deal with this calculation flaw?
Thank
only approximates the mathemetical value of equations. I needed t
develop a spreadsheet that tested if an experimental value was withi
certain limits and found that Excel frequently gave misleading result
due to the error in the approximations it was computing. I onl
discovered the source of the bug after expanding the calculated result
to their full decimal place as illustrated below:
Column B subtracted from Column A should always be 0.0616
A B A-B
1.0616 1 0.061600000000000100000000000000
2.0616 2 0.061599999999999900000000000000
3.0616 3 0.061599999999999900000000000000
4.0616 4 0.061600000000000300000000000000
5.0616 5 0.061600000000000300000000000000
6.0616 6 0.061600000000000300000000000000
7.0616 7 0.061600000000000300000000000000
8.0616 8 0.061600000000000300000000000000
9.0616 9 0.061600000000000300000000000000
10.0616 10 0.061600000000000300000000000000
when using the formula:
= if( (A-B)>= 0.0616, "PASS" , "FAIL" )
Values for B = 2 and 3 give erroneous results (as well as othe
combinations yielding 0.0616) .
I fixed the bug by adding a round() function to the equation but wa
disturbed by the inacuracy of Excel's calculations, even though i
occurs at 10 to the minus 16 decimal place.
Does anyone know how to better deal with this calculation flaw?
Thank