Display random numbers whose sum equal to specified number

mabubakerali

New Member
Joined
Feb 23, 2016
Messages
28
Hi, i was having an issue related to my job so i just explain that straight,
I have written a number in cell a1 lets say its 200000, now i want excel to display random numbers in cell b1,b5,b10 and the sum of them must be equal to the number specified in a1 which is 200000..

Is there any way to do that since the workload is big and it would be of great help
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
try


Book1
AB
12000006191
2
3
4
588256
6
7
8
9check
10200000105553
Sheet2
Cell Formulas
RangeFormula
B1=RANDBETWEEN(1,A1-3)
B5=RANDBETWEEN(1,(A1-B1)-2)
B10=A1-B1-B5
 
Upvote 0
Here is one way:

In B1, enter this formula:
=RANDBETWEEN(0,A1)

In B5, enter this formula:
=RANDBETWEEN(0,A1-B1)

In B10, enter this formula:
=A1-B1-B5


EDIT: Doh! A little too slow, as Alan and I had the same idea, but he beat me to it.
Note that since you want it to sum up to exactly a specific value, only the first two numbers are random, as the third must be the difference to add up to your value.
 
Last edited:
Upvote 0
Thanks man, i appreciate your help
try

AB
12000006191
2
3
4
588256
6
7
8
9check
10200000105553

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
B1=RANDBETWEEN(1,A1-3)
B5=RANDBETWEEN(1,(A1-B1)-2)
B10=A1-B1-B5

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top