+ Reply to Thread
Results 1 to 3 of 3

array of 12 random numbers that total 100

  1. #1
    Registered User
    Join Date
    02-12-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    1

    array of 12 random numbers that total 100

    Hi Guys,

    I am hoping someone can help me out really,

    I am looking to generate an array of 12 random numbers that total 100.

    The main point is, I want to specify a range that each of the 12 values must fall between.

    Is this possible in Excel?

    I have done very little VBA programming, but can probably struggle through.

    Thanks in advance....
    Last edited by VBA Noob; 02-15-2009 at 01:48 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Help needed with array generation

    Try the attachment.
    Attached Files Attached Files
    Martin

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: array of 12 random numbers that total 100

    Maybe like this:
    Please Login or Register  to view this content.
    Formulas:

    B1 is the target number

    A3:A14 =RAND()

    B3 and copy down to B14 =IF(A3=0, 0, ROUND( ($B$1 - SUM(B$2:B2) ) * A3 / ($A$15 - SUM(A$2:A2)), 0) )

    A15 and copied to B15: =SUM(A3:A14)

    B15 verifies that the numbers sum to the target.
    Last edited by shg; 02-16-2009 at 09:47 AM.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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