Closed Thread
Results 1 to 2 of 2

Fill cells randomly constraining/restricting row and column sum

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    Bogota
    MS-Off Ver
    Excel 2007
    Posts
    4

    Fill cells randomly constraining/restricting row and column sum

    I already posted this question in the general forum but perhaps someone here could help me out with this issue.

    I need to fill randomly a set of more than 20 rows and columns with numbers from 0 to 4. However, I need to set a limit to the sum of each line and each column. Lets say, each row has to sum up to a value equal or lower than 4 and each column to a value equal or lower than 6.
    The remaining cells could be filled with zeros.

    One example could be:

    0 1 2 0 0 0 0 1
    0 3 0 1 0 0 0 0
    1 0 0 2 0 0 0 0
    4 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 1 0 0

    Is there a formula/command to make this possible? If so, would it be possible to also set the distribution of the date (i.e Normal)?

    Another way of doing this I have thought of is to fill the cells myself, instead of letting Excel do it randmonly. But either way I've got the same issue. I'd want Excel to only let me use values form 0 to 4, so that if I fill the cells of the row and it sums up to 4 or less it'd either stop me or let me fill other cells but changing/adjusting automatically the values of the former ones, so that it will always sums 4 or less. And same thing with the columns.

    An example:

    0 1 1 0 0 1 0 4 --> The sum is greater than 4, so the former values would be automatically so that the condition of summing up to 4 would be met. This way, the modified row could be etiher:
    0 1 1 0 0 1 0 1, or , 0 1 1 0 0 1 0 0

    THANKS A LOT!

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Fill cells randomly constraining/restricting row and column sum

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

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