View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Wrong sum value after calculate with Percentage

On Nov 19, 8:24*pm, I wrote:
the presumption is that sum(B1:B4) is less than
100%. *That might not be the case due to rounding.
*It would be safer to replace ROUND with ROUNDDOWN.


On second thought, this could cause more problems than it solves. It
is probably better to live with the fact that the manual (by-hand) sum
of the displayed percentages might be more or less than 100%.

The problem with ROUNDDOWN is: it accumulates all of the numerical
"error" into the last figure. That can skew the last figure
significantly.

The problem with ROUND is: it could cause 1-sum(B1:B4) to go
negative. That can be avoided by computing max(0,1-sum(B1:B4)). But
that's only a bandaid. It can still skew the last figure.

I do habitually use ROUND for the individual computations -- for
example, =round(A1/$A$6,4). But that is only to mitigate the
propagation of numerical "error" that is inherent in binary computer
arithmetic; that is, to ensure that WYSIWYG.