View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Formula calculating to the 3rd decimal

On Nov 26, 8:41*pm, Shayla2008
wrote:
I have never encountered this in excel 2003


I am surprised, because this is actually a very common problem.


Previous, you wrote:
My formatting in the cells are for 2 decimal places. How can
I ensure the formula is also calculating to only the 2nd decimal
place?


Formatting only changes the __appearance__ of numbers. The cell value
is often different. For example, enter the number 12.345, then format
as Number with 2 decimal places. The value __appears__ to be 12.35,
but it is still 12.345, a fact that you can confirm by writing =(A1 =
12.35) into a cell; the result will be FALSE.

To answer your question, there are two common ways to do this:

1. Set the option Tools Option Calculation Precision as
Displayed.

2. Use the ROUND function liberally. (See below.)

I usually deprecate #1 because: (a) you can unintentionally lose
precision permanently; and (b) you might still not get the "correct"
result (i.e. to your satisfaction) when combining cells with different
precision.


Example:
cell A3 *=sum(A1-A2) is $2510.63
cell A4 *=sum (A3*.05) is $125.53
cell A5 *=sum(A3*.07) is $ 175.74
=sum(A3+A4+A5) should equal 2811.90


First, applying suggestion #2, I would write those formulas as

A3: =round(A1-A2, 2)
A4: =round(A3*0.05, 2)
A5: =round(A3*0.07, 2)
A6: =round(A3+A4+A5, 2)

Second, unless A1 and A2 contain constants, I would also round the
formulas in those cells.

Rounding the sum in A6 ensures that WYSIWYG.

However, if your intention is to retain the full precision of the
values calculated in A1:A5 and you only want to ensure that the sum in
A6 uses their rounded values, the second or both of the following
formulas might meet you needs:

A3: =round(A1,2) - round(A2,2)

A6: =sum(round(A3:A5,2))

Note that the second formula is an array formula. Use ctrl-shift-
Enter to commit instead of simply Enter.