+ Reply to Thread
Results 1 to 5 of 5

Random number generation that adds up to X

  1. #1
    Registered User
    Join Date
    09-30-2016
    Location
    York
    MS-Off Ver
    2010
    Posts
    2

    Post Random number generation that adds up to X

    Hi

    I have built a model but need to make a test data set. On every 13th line I have data, but I need to randomly distribute this data across the previous 12 rows (the allocation to each cell needs to be random, but all 12 cells must add up to the value in the 13th cell).

    Is there a way of doing this?

    Thanks

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Random number generation that adds up to X

    How does this look? One formula in column B and a second in column C, copied across. All inputs (other than the total) are defined at the top of the sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Random number generation that adds up to X

    Can you adapt the following paradigm?


    A
    B
    C
    D
    E
    1
    Period#
    Actual Actual% RAND Target%
    2
    1 14,252 14.25% 0.700073 14.25%
    3
    2 14,373 14.37% 0.706013 14.37%
    4
    3 7,440 7.44% 0.365492 7.44%
    5
    4 5,942 5.94% 0.291868 5.94%
    6
    5 3,363 3.36% 0.165198 3.36%
    7
    6 1,429 1.43% 0.070175 1.43%
    8
    7 19,326 19.33% 0.949316 19.33%
    9
    8 228 0.23%
    0.011181 0.23%
    10
    9 2,558 2.56% 0.125647 2.56%
    11
    10 18,867 18.87% 0.926801 18.87%
    12
    11 11,984 11.98% 0.588663 11.98%
    13
    12 238 0.24% 0.011802 0.24%
    14
    total 100,000
    4.912229 sum RAND
    15



    100,000 check sum
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-30-2016
    Location
    York
    MS-Off Ver
    2010
    Posts
    2

    Re: Random number generation that adds up to X

    Thanks Glenn,

    This is quite what I wanted, just going downward rather than across, but I think I can adapt it!

    Cheers,

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Random number generation that adds up to X

    Let me know if you hit a brick wall.

+ 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. Random Number Generation
    By RalphJ in forum Excel General
    Replies: 1
    Last Post: 06-25-2010, 12:51 PM
  2. Random Number Generation
    By vioravis in forum Excel General
    Replies: 3
    Last Post: 02-27-2009, 08:39 PM
  3. Random number generation
    By Alan Davies in forum Excel General
    Replies: 3
    Last Post: 02-27-2006, 05:40 PM
  4. [SOLVED] Random Number Generation
    By MB06 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2006, 04:45 PM
  5. random number generation
    By scotjo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-09-2006, 12:10 PM
  6. [SOLVED] random number generation
    By DSpec in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2005, 09:05 AM
  7. I need help with random number generation
    By David Stoddard in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-28-2005, 03:06 AM
  8. Random number generation
    By Stratuser in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-15-2005, 09:06 AM

Tags for this Thread

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