Randomly Distributing A Pre-Determined Sum Over 12 Non-Contiguous Cells

HGLIII

New Member
Joined
Jun 19, 2019
Messages
14
Good Afternoon,

Does anyone know of a way to distribute a certain number (say 25,000,000) over a group of non-contiguous cells, while adhering to a floor, or minimum number, for each respective cell? Also, formulas in the past have been "biased" toward the upper-most positioned cells (so that the distribution falls unevenly, skewed toward the first 2 or 3 cells), so we would need to avoid that if possible.

Looking for something along the lines of:

Total Sum: 25,000,000
Minimum Increments: 100,000

1. 5,000,000
2. 7,500,000
3. 100,000
4. 1,300,000
5. 11,100,000
etc.

Thanks very much!

HGL

P.S. - I know some members have kindly offered their help in the past, but for some reason none of the suggestions seem to end up working. Perhaps this is impossible...
 

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
Good evening.

P.S. - I know some members have kindly offered their help in the past, but for some reason none of the suggestions seem to end up working. Perhaps this is impossible...
In that case it might have been helpful to say what you've already tried, and in what way it didn't work.

Anyway, here's one idea.

In A1 - Total Sum Value
In A2 - Minimum Increments Value

In B1
=rand()

Copy this down for however many values you want, let's say 5, so =rand() is in every cell in B1:B5.

In C1
Code:
=ROUND(A$1*(B1/SUM(B$1:B$5)),-LOG(A$2))
And copy down as far as required, in this case C1:C5.

Note that this won't ALWAYS sum exactly back to the Total Sum, because of the way that the rounding works.
A crude way to correct this would be to make one of the values be a simple differential between the sum of all the other values, and the Total Sum.
 
Last edited:

HGLIII

New Member
Joined
Jun 19, 2019
Messages
14
Gerald, I implemented the overall formula and differential suggestion, and it worked beautifully - thank you very, very much!
 
Last edited:

Forum statistics

Threads
1,081,981
Messages
5,362,535
Members
400,679
Latest member
alecalec202

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top