PC Review


Reply
Thread Tools Rate Thread

100% quandry

 
 
Mojo
Guest
Posts: n/a
 
      31st May 2009
Hi All

This might be an age old problem, but I just wanted to see if I wasn't
missing something obvious in my code.

Basically I have say 31 people (this figure can range from 10 to 100) who
are put into 8 categories. Once they have been categorised I simply need to
show how many are in each category as a number and as a percentage. Now the
number aspect of display is easy, but I'm coming unstuck with the percetange
aspect.

In essence as I do my % calc for each category sometimes certain values are
1% less or more than they should be and as you add up the displayed figures
the total might come out at 99% or 101%, which looks daft.

An example of a display problem is as follows

1 0 2 9 11 5 0 2 = 30 people
3% 0% 7% 30% 37% 17% 0% 7% = 101% !!!!

My code for each percentage value is simply:

Round((intPeopleCount / intTotalPeopleCount) * 100, 0) & "%"

I really want to make this work, but it seems fraught with issues!!

Any ideas?

Thanks



 
Reply With Quote
 
 
 
 
Howard31
Guest
Posts: n/a
 
      31st May 2009
Hi Mojo,

First use percentage format in all the cells you want to display as
percentages, including the cell that will contain the 100% result. Then in
all the peoples percentage cells use the following formula:

=C1*0.01/(SUM($C1:$H16)*0.01)

In the result cell simply use a sum formula of all the percentage people

Hope this helps.

--
A. Ch. Eirinberg


"Mojo" wrote:

> Hi All
>
> This might be an age old problem, but I just wanted to see if I wasn't
> missing something obvious in my code.
>
> Basically I have say 31 people (this figure can range from 10 to 100) who
> are put into 8 categories. Once they have been categorised I simply need to
> show how many are in each category as a number and as a percentage. Now the
> number aspect of display is easy, but I'm coming unstuck with the percetange
> aspect.
>
> In essence as I do my % calc for each category sometimes certain values are
> 1% less or more than they should be and as you add up the displayed figures
> the total might come out at 99% or 101%, which looks daft.
>
> An example of a display problem is as follows
>
> 1 0 2 9 11 5 0 2 = 30 people
> 3% 0% 7% 30% 37% 17% 0% 7% = 101% !!!!
>
> My code for each percentage value is simply:
>
> Round((intPeopleCount / intTotalPeopleCount) * 100, 0) & "%"
>
> I really want to make this work, but it seems fraught with issues!!
>
> Any ideas?
>
> Thanks
>
>
>
>

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      1st Jun 2009
because you're actually rounding values, you're altering them ...so it's
quite likely that your numbers won't sum to 100%

eg 34. 34 + 34.34 + 31.32= 100
BUT 34.3 + 34.3 +31.3 = 99.9

I'd recommend that you leave your formula unadjusted,
=(intPeopleCount / intTotalPeopleCount) * 100

and that you FORMAT the cells to show integegers.

"Mojo" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Hi All
>
> This might be an age old problem, but I just wanted to see if I wasn't
> missing something obvious in my code.
>
> Basically I have say 31 people (this figure can range from 10 to 100) who
> are put into 8 categories. Once they have been categorised I simply need
> to
> show how many are in each category as a number and as a percentage. Now
> the
> number aspect of display is easy, but I'm coming unstuck with the
> percetange
> aspect.
>
> In essence as I do my % calc for each category sometimes certain values
> are
> 1% less or more than they should be and as you add up the displayed
> figures
> the total might come out at 99% or 101%, which looks daft.
>
> An example of a display problem is as follows
>
> 1 0 2 9 11 5 0 2 = 30
> people
> 3% 0% 7% 30% 37% 17% 0% 7% = 101% !!!!
>
> My code for each percentage value is simply:
>
> Round((intPeopleCount / intTotalPeopleCount) * 100, 0) & "%"
>
> I really want to make this work, but it seems fraught with issues!!
>
> Any ideas?
>
> Thanks
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A quandry cirianz General Discussion 20 26th Jul 2007 09:30 AM
Another SQL quandry Stewart Microsoft Access VBA Modules 7 22nd Apr 2007 11:47 PM
Quandry Westmoreland Windows XP Help 0 29th Mar 2006 05:21 PM
QBF quandry! Kagsy Microsoft Access 1 22nd Mar 2005 03:25 PM
Quandry?!! =?Utf-8?B?QnJhbmRvbg==?= Microsoft Access Forms 1 23rd Mar 2004 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:41 AM.