+ Reply to Thread
Results 1 to 1 of 1

Generate N random numbers whose sum is constant K and constant L by dividing J

  1. #1
    Registered User
    Join Date
    11-11-2015
    Location
    Jogannesburg, South Africa
    MS-Off Ver
    2010
    Posts
    1

    Generate N random numbers whose sum is constant K and constant L by dividing J

    I need to generate random numbers whose sum is K. Also these random number need to be divided by a constants J to give me the sum of L. Let me explain by way of a little data grid.

    Total of Sum K 5044.00
    Total of Sum L 6837.42

    Capture.JPG

    Item Random number Sun K Constant J Sum L
    1 0.00000000 0.00000000 0.3333 0.00000000
    2 0.10868186 131.19367850 0.3750 349.84980932
    3 0.59150255 714.02342638 0.4167 1713.51914179
    4 0.00669870 8.08623823 0.5000 16.17247646
    5 0.00000000 0.00000000 0.5833 0.00000000
    6 0.74483945 899.12176693 0.6250 1438.59482708
    7 0.70382438 849.61103911 0.7500 1132.81471881
    8 0.47850676 577.62225548 0.8333 693.17443355
    9 0.60530603 730.68608678 0.8750 835.06981346
    10 0.93912902 1133.65550860 0.9167 1236.67013047
    11 0.00000000 0.00000000 1.0000 0.00000000
    4.17848875 5044.00 7.2083 7415.86535094

    Sum K = 5044.00 Sum L = 6837.42


    If I don't want the item included I just replace the generated Random # with 0.

    Random number are generated with =RAND()

    Ok so to Calculate K is quite easy >> =Item1/SUM(Random numbers)*5044.00

    To Calculate Item1 Const L >> Item1 K / Item1 Const J.

    SO here is the problem The sum of Column K = 5044, I need the Sum of L to be 6837.42.



    Any help with this formula would be appreciated. I can paste my code if needed.
    Last edited by Eldaoud; 11-11-2015 at 04:30 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Keeping numbers constant
    By skillsguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2015, 06:54 AM
  2. VBA code to keep numbers constant
    By mkeys4 in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 08-16-2013, 09:21 AM
  3. I need numbers in given cells to multiply by a constant number
    By normanluc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-27-2012, 12:16 AM
  4. Sum of constant + variable = constant
    By neurogirl900 in forum Excel General
    Replies: 3
    Last Post: 12-19-2011, 11:02 PM
  5. Constant random crashes
    By Dangerus9 in forum Excel General
    Replies: 1
    Last Post: 06-03-2010, 03:55 PM
  6. [SOLVED] extract numbers from text or a constant
    By Stephanie in forum Excel General
    Replies: 9
    Last Post: 05-14-2006, 05:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1