< Back to screenshot

Random variables

PopTools includes formulas to generate random variables from the following distributions:

These functions can be entered from the PopTools menu, or (in PopTools version 1.2 and above) through the standard Excel function wizard (the button that looks like this ). There are two versions of each formula, but you should always use the direct DLL versions, which are fast. The older versions are retained for backwards compatibility. The formula names of the direct DLL versions are preceded by a lowercase "d", as shown in the example below for a Poisson random variable with parameter 5.

Formula Type Type of result
=dPoisson(5) Direct DLL version (fast) Volatile
=Poisson(5). VBA version (slow) Volatile

A new feature in PopTools version 1.4 and above is the ability to enter random variables as arrays. These functions make a single call to the DLL and are generally much faster than the versions entered in just a single cell. The array versions take have an "A" appended to their name and take an extra argument specifying how many variables to generate. For example, the following generates 1000 variables from the Poisson distribution with parameter 5:

=PoissonA(5,1000). DLL version (fast) Volatile