Generating a random list of numbers

JeremySchubert

New Member
Joined
Jun 23, 2011
Messages
6
Is it possible to get Excel to generate a random list of numbers from the Real Numbers set that includes results with the radical sign, the repeating sign or a fraction?
IMG_4150.png
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You could generate a table with some pseudo-random numbers and format the results (fractions, radical sign, etc.).
Is this what you want?

You could use formulas RAND, RANDARRAY or RANDBETWEEN

RAND will return a random decimal between 0 and 1
RANDARRAY will spill a table with random numbers. You can specify the number of rows and columns, minimum and maximum value and the number type (integer or decimal)
RANDBETWEEN will return a random number within the specified range
 
Upvote 0
You could generate a table with some pseudo-random numbers and format the results (fractions, radical sign, etc.).
Is this what you want?

You could use formulas RAND, RANDARRAY or RANDBETWEEN

RAND will return a random decimal between 0 and 1
RANDARRAY will spill a table with random numbers. You can specify the number of rows and columns, minimum and maximum value and the number type (integer or decimal)
RANDBETWEEN will return a random number within the specified range
Thank you. I will use RANDARRAY to create a table of numbers. Then I will format some of the results as radicals and fractions.
If I want to use RANDARRAY to create both integers and decimals, do I have to create 2 sheets? One using each number type? And then paste the contents of one sheet into the other?
 
Upvote 0
If I want to use RANDARRAY to create both integers and decimals, do I have to create 2 sheets?
No. Here is one way. This formula should, on average produce about half integers and half decimals, though on this particular occasion it has produced just 3 integers out of 10 results. If you want to weight the number of integers v decimals differently, you can change the 0.5 in the formula.

23 10 23.xlsm
C
12
25.044089
37.64004
47.739514
54.519902
63
79
86.113683
92.745343
108.852008
Integers v Decimals
Cell Formulas
RangeFormula
C1:C10C1=BYROW(RANDARRAY(10,1,0,10),LAMBDA(r,IF(RAND()<0.5,INT(r),r)))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,232
Members
449,092
Latest member
SCleaveland

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