Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Percentage Rounding VBA

  Asked By: Pamela    Date: Dec 27    Category: MS Office    Views: 918
  

My eyes are falling off now. I tried everything below but my question is not
answered

Excel build in formula
Tool => Option => Calculation => Percision as displayed. It crashed my
excel.
Searched web but most usergroup posting is dated back in 1990's

Problem:

Formula is entered to calculate % of total. If % is added up manually, the
number doesn't add up to 100%. Does anyone have a costum formula that
automatically roundup or rounddown any % so the total add up to 100%?

Example:

A + B + C + D + E + F
= Total
$15,129 + $20,030 + $48,858 + $26,353 + $15,275 + $32,805 = $158,451

Using Round(X,2) to calculate % of total

10% + 13% + 31% + 17% + 10% + 21% = 102%, Not
100%

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Brent Brown     Answered On: Dec 27

I'm just wondering if you realize that to accomplish what you're asking
would require someone to override a correct mathematical calculation.



The inequality you're experiencing is simply a risk associated with
truncating precise numbers and if that level of precision isn't
aesthetically pleasing or confuses your audience, rounding  to one
decimal place will probably get you where you need to be.



10% + 10% + 30% + 20% + 10% +20% = 100%



FYI - the numbers will finally equal 100.0000% when rounded to five
decimal places.

 
Didn't find what you were looking for? Find more on Percentage Rounding VBA Or get search suggestion and latest updates.




Tagged: