PC Review


Reply
Thread Tools Rate Thread

Creating random percentages totalling 100%

 
 
agbiggs@hotmail.com
Guest
Posts: n/a
 
      6th Feb 2007
I'm trying to simulate a variety of allocations to an investment
portfolio; eg, 10% to stocks, 20% to corporate bonds, 70% to
government bonds, etc. I'd like to randomly generate portfolio
allocations, the problem being that they have to total 100%. Is there
a way with the RANDBETWEEN function to do something like this? Thanks,

Andrew

 
Reply With Quote
 
 
 
 
Niek Otten
Guest
Posts: n/a
 
      6th Feb 2007
Hi Andrew,

Divide each random number by the sum of all random numbers and use that to multiply with the total available investment.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
| I'm trying to simulate a variety of allocations to an investment
| portfolio; eg, 10% to stocks, 20% to corporate bonds, 70% to
| government bonds, etc. I'd like to randomly generate portfolio
| allocations, the problem being that they have to total 100%. Is there
| a way with the RANDBETWEEN function to do something like this? Thanks,
|
| Andrew
|


 
Reply With Quote
 
agbiggs@hotmail.com
Guest
Posts: n/a
 
      6th Feb 2007
Very clever -- thanks!

Andrew

 
Reply With Quote
 
Bernd
Guest
Posts: n/a
 
      6th Feb 2007
Hello,

I would not necessarily divide by the sum. The resulting distribution
is biased.
There are several ways. Three possible approaches are shown here:
http://www.sulprobil.com/html/randsum1.html

Regards,
Bernd

 
Reply With Quote
 
agbiggs@hotmail.com
Guest
Posts: n/a
 
      7th Feb 2007
Thanks very much -- very helpful.

Andrew





 
Reply With Quote
 
joeu2004
Guest
Posts: n/a
 
      7th Feb 2007
On Feb 6, 12:37 pm, "agbi...@hotmail.com" <agbi...@hotmail.com> wrote:
> I'm trying to simulate a variety of allocations to an investment
> portfolio; eg, 10% to stocks, 20% to corporate bonds, 70% to
> government bonds, etc. I'd like to randomly generate portfolio
> allocations, the problem being that they have to total 100%. Is there
> a way with the RANDBETWEEN function to do something like this?


The following assumes that you do not want 0% for any asset class.

The formula (in A1, say) for the first of, say, 8 asset classes might
be:

=randbetween(1, 100 - 7)

The formula (in A2) for the second of, say, 8 asset classes is:

=randbetween(1, 100 - sum($A$1:A1) - (8-count($A$1:A1)-1)))

Copy that formula for all but the last asset class. "A1" will be
updated automatically.

The formula for the last (8th) asset class is:

=100 - sum(A1:A7)

Note that all numbers are integers, not percentages. If we divide
each formula by 100, then 100*SUM(...) might not be exactly the same
as the sum of the integral values (before dividing by 100) -- although
ROUND(100*SUM(...),0) might be(?). If you can tolerate that, fine.
Otherwise, put =A1/100 in another column, and copy down.

Finally, beware that RANDBETWEEN() will be recomputed every time you
change any cell in the worksheet. Usually, that is undesirable. You
can minimize the impact by disabling auto recalculation. I would
avoid it by creating the VBA function MyRandBetween().

 
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
Creating a formula which includes percentages =?Utf-8?B?bWRhMTk2NTI=?= Microsoft Excel Misc 3 4th Jun 2007 11:03 AM
SUMs, totalling, but not totalling with every record.. Geel Microsoft Access 4 4th Dec 2006 11:27 AM
Creating a random scheduler. timjm Microsoft Excel Misc 2 14th Aug 2006 08:39 AM
Creating Percentages Roshawn Microsoft VB .NET 2 29th Jul 2004 05:21 AM
formula for creating percentages dolingercha@aol.com Microsoft Excel Worksheet Functions 2 15th Jul 2004 05:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 AM.