+ Reply to Thread
Results 1 to 3 of 3

Random numbers from specific range with fixed sum in Excel

Hybrid View

  1. #1
    Registered User
    Join Date
    11-29-2017
    Location
    UK,Singapore
    MS-Off Ver
    2016
    Posts
    1

    Random numbers from specific range with fixed sum in Excel

    Hello,
    I'm a school teacher and recently I lost my specific marks. I only have the total marks with me. I'm desperately looking for formula to divide / distribute marks RANDOMLY from the total to each cell by SPECIFIC RANGE? Any kind soul please help me.

    TnxNd8K.jpg

    Download excel file: https://drive.google.com/open?id=1kj...Djx9JvcFpaU3SK
    Last edited by mr.ibrism; 11-30-2017 at 09:05 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,661

    Re: Random numbers from specific range with fixed sum in Excel

    C2 and copy down/right:
    Formula: copy to clipboard
    =RANDBETWEEN(MAX(0,2*$B3-SUM($B3:B3)-SUM(D$2:$L$2)),MIN(C$2,2*$B3-SUM($B3:B3)))


    Note that for students: 8, 17, 18 you will get errors, because they collected 60 points, while max available total was 56 - please next time prepare REPRESENTATIVE sample data.

    Also note that this formula refers one column right from your table, (column L), so for second sheet it shall be:
    Formula: copy to clipboard
    =RANDBETWEEN(MAX(0,2*$B3-SUM($B3:B3)-SUM(D$2:$H$2)),MIN(C$2,2*$B3-SUM($B3:B3)))
    (up to column H)
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,661

    Re: Random numbers from specific range with fixed sum in Excel

    Glad it worked for you, and thanks for marking SOLVED and for reputation.


    As for problems with attaching files:
    Unfortunately attachment icon do not work at the moment , so next time after writing a post, but before posting, scroll down and press Go Advanced button and then scroll down and press Manage Attachments link. Now follow the instructions at the top of that pop-up screen.

+ 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. Generating Random numbers that will sum to 1 specific value?
    By zr11 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-24-2019, 10:08 AM
  2. Replies: 2
    Last Post: 11-29-2016, 10:21 AM
  3. [SOLVED] random numbers with mean and stdev fixed
    By yamboe in forum Excel General
    Replies: 2
    Last Post: 11-26-2015, 01:29 PM
  4. Random numbers to specific total
    By juriemagic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2015, 02:20 AM
  5. Fixed Random Numbers
    By ameyjohn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-21-2005, 10:13 AM
  6. [SOLVED] Non-random numbers generated by excel's data analysis random gener
    By Allie in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-17-2005, 02:05 AM
  7. [SOLVED] Re: Non-random numbers generated by excel's data analysis random gener
    By Harlan Grove in forum Excel General
    Replies: 2
    Last Post: 09-13-2005, 12:05 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