randomexcel-2010random-seed# Setting seed for Excel random number generator

In excel below formula will generate random number from a normal distribution with mean 10 and variance 1. Is there a way to set a fix seed so that i get a fix set of random numbers all the time? I am using Excel 2010

```
=NORMINV(RAND(),10,1)
```

Solution

You can implement your own random number generator using spreadsheet functions. For example, C++11 has a Lehmer random number generator called `minstd_rand`

which is obtained by the recurrence

```
X = X*g (mod m)
```

where `g = 48271`

and `m = 2^31-1`

In `A1`

you can place your seed value. In `A2`

enter the formula:

```
=MOD(48271*A1,2^31-1)
```

and copy it down however far you need.

In `B2`

enter `=A2/(2^31-1)`

and in `C2`

enter `=NORM.INV(B2,10,1)`

, copying as needed. Note that you can always replace the seed value in `A1`

by

```
=RANDBETWEEN(1,2^31-2)
```

if you want to turn volatile randomness back on.

The following screenshot shows 25 random normal variables generated in this fashion:

As you can tell from the histogram the distribution seems roughly normal.

- Generating a random uint64_t
- Update Table with random value in one column for all rows
- Select single random sample from group by in Hive
- Clarifying the Process of Generating iid Gaussian Random Vectors in MATLAB
- Using "$RANDOM" to generate a random string in Bash
- Generate alphanumeric string with 2 letters and 5 digits
- How to generate uniformly distributed subintervals of an interval?
- Generating random number in a non-power-of-2 range from random bits
- Why are all the strings the same
- How to pick between 2 numbers
- Randomly placed circles sometimes go out of the canvas when the code says otherwise
- random.seed() does not work with np.random.choice()
- how does this logic work: num=(rand()%(a+1));
- Fastest way to generate a matrix using beta.rvs in python
- c++ rand() insignificant change
- Is there functionality to generate a random character in Java?
- How do I create a random String by sampling from alphanumeric characters?
- Generating a (random) sequence of multiple characters in R
- random.random vs. numPy.random
- How do I select a random value from an enumeration?
- How do you generate an image where each pixel is a random color in python
- Is this a stupid way to handle session storage with PostgreSQL? Should I use GENERATED values?
- C++17: g++ Version 8.5 Seems to not be Properly Generating Unsigned 64-Bit Pseudorandom Integers
- Generating random numbers over a range in Go
- Is it good practice to shuffle character set before they are picked randomly
- Most efficient method of generating a random number with a fixed number of bits set
- Python create a random pin four digits long using random
- Weighted random sample in python
- Randomly make certain rows NA on a specific column in a dataframe
- How can I generate random alphanumeric strings?