Excel Random Number Generator Code.

cpatel13

Board Regular
Joined
Jan 4, 2016
Messages
59
Hie all,

Basically i am creating a excel sheet where i would be required to have random numbers in a particular range and in multiples for 5 and all the numbers generated should have the total which is entered. Let me elaborate

Input Number- 136400
Random Numbers Range- 12000 to 15000 (Range can be changed accordingly)
Random Numbers Generated
14250
13750
12900
12750
15000
14700
13930
14260
12860
12000

Random Number's total Should match the Input Number
Also the Random Number should not be repeated twice same in the same sequence.

I have Tried to have a look on various forums, but didn't got a proper match for what i was looking for.

Thanks,
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
To generate random numbers and not repeat base something on this.

Random list, no duplicates
A1:A3000 Enter the list of names/numbers to be used in this case generate the numbers 12000 to 15000
B1:B3000 =RAND()
C1:C3000 =INDEX(A$1:A$3000,MATCH(SMALL(B$1:B$3000,ROW()),B$1:B$3000,0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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