Generate better random numbers for Excel! ZRandom implements a high quality pseudo-random number generator for Microsoft Excel. You can use them as excel functions, from VBA or from the ZRandom menu.
The RAND() formula in ExcelŽ and the Rnd() function in VBA use very simple algorithms to generate pseudo-random numbers. In some ExcelŽ versions, RAND() can even generate negative numbers! If a high degree of randomness or a large quantity of random numbers are required, these functions should not be used. ZRandom uses the Mersenne Twister algorithm to generate pseudo-random numbers, one of the best algorithms available. Mersenne Twister is very fast and has a cycle period of 219937 - 1.
ZRandom implements 16 discrete and continuous distributions. Pseudo random numbers can be generated from each distribution using the distribution wizard, using native spreadsheet formulas or by using the VBA functions. The 16 distributions are:
Bernoulli
Beta
Burr
Exponential
Gamma
Geometric
Hypergeometric
Lognormal
Negative Binomial
Normal
Pareto
Poisson
Triangular
Uniform (cont.)
Uniform
Weibull
The Mersenne Twister generator and all distributions are available as formulas and can be used directly in spreadsheet cells. The ZRandom formulas can also be used as part of in more complicated formulas. ZRAND and ZRANDBETWEEN accept an optional seed and can return both single cell values and arrays for even greater speed. The ZSAMPLE function samples a random value from a list:
Bernoulli=ZBERNOULL(p)
Beta=ZBETA(a,b)
Burr=ZBURR(alpha,theta,gamma)
Exponential=ZEXPONENTIAL(mean)
Gamma=ZGAMMA(alpha,theta)
Geometric=ZGEOMETRIC(p)
Hypergeometric=ZHYPERGEOMETRIC(p)
Lognormal=ZLOGNORMAL(mu,sigma)
Negative Binomial=ZNEGATIVEBINOMIAL(r,p)
Normal=ZNORMAL(mean, stddev)
Pareto=ZPARETO(alpha,theta)
Poisson=ZPOISSON(lambda)
Triangular=ZTRIANGULAR(minimum,maximum [, peak])
Uniform (cont.)=ZUNIFORM(minimum,maximum)
Uniform=ZRAND(MIN, MAX)
Weibull=ZWEIBULL(theta, tau)
ZRandom can also be used from your VBA projects, just add a reference to "ZRandom" and use ZRandom.Next and ZRandom.NextBetween to generate random numbers, or use one of the functions to generate random variables from a probability distribution like NextPareto or NextHypergeometric.
Features:
Use the high quality Mersenne Twister algorithm to generate better pseudo-random numbers than the RAND() formula in ExcelŽ and Rnd() function in VBA.
Generate random numbers from 16 discrete and continuous distributions.
Formulas for use in spreadsheet cells.
A VBA interface to generate random numbers in your code.
Generate large amounts of random numbers interactive user interface.
Generate random samples from a table or random sort existing data. |