Calculates the inverse of the normal cumulative distribution for the specified mean and standard deviation The NORMINV Function[1] is categorized under Excel Statistical functions. It will calculate the inverse of the normal cumulative distribution for the specified mean and standard deviation. Suppose we are given a normally distributed random variable that is denoted by x. For the value of x, if we wish to get the bottom 10% of the distribution, we can use the NORMINV function. As a financial analyst, NORMINV is useful in stock market analysis. We can use the function to understand how a portfolio is affected by any additions or withdrawals made. Formula=NORMINV(probability,mean,standard_dev) The NORMINV formula uses the following arguments:
The Normal distribution is a continuous probability function and is given by the formula: Where:
How to use the NORMINV Function in Excel?To understand the uses of the NORMINV function, let’s consider an example: ExampleSuppose we are given the following data:
If we wish to calculate the value of the function, the formula will be: We get the result below: Things to remember about the NORMINV Function
Click here to download the sample Excel file Additional ResourcesThanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources: Article Sources
It is often useful to create a model using simulation. Usually, this takes the form of generating a series of random observations (often based on a specific statistical distribution) and then studying the resulting observations using techniques described throughout the rest of this website. This approach is commonly called Monte Carlo simulation. Worksheet FunctionsExcel Function: Excel provides the following functions for generating random numbers. RAND() – generates a random number between 0 and 1; i.e. a random number x such that 0 ≤ x < 1. RANDBETWEEN(a, b) – generates a random integer between a and b (inclusive) Note that these functions are volatile, in the sense that every time there is a change to the worksheet their value is recalculated and a different random number is generated. If you don’t want this to happen, then enter RAND() on the formula bar and press the function key F9. This will replace the formula RAND() by the value generated. Alternatively, you can copy the random number (or a range of random numbers) using Ctrl-C and then paste them back into the same location using Home > Clipboard|Paste and then selecting the Paste Values option. RANDBETWEEN only generates integer values. If you want a random number which could be any decimal number between a and b, then use the following formula instead: = a + (b − a) * RAND() Excel 365 Function: Excel 365 provides the following dynamic array function with spillover (see Dynamic Array Formulas). RANDARRAY(nrows, ncols, a, b): fills an nrows × ncols range starting in the current cell with random numbers between a and b inclusive. RANDARRAY(nrows, ncols, a, b, TRUE): fills an nrows × ncols range starting in the current cell with random integers between a and b inclusive. If omitted nrows, ncols, and b default to 1, and a defaults to 0. E.g. to generate 10 random numbers between 0 and 1 using Excel 365, you enter the formula =RANDARRAY(10) in cell A1 and press Enter. If you are not using Excel 365, you can instead enter the formula =RAND() in cell A1, highlight range A1:A10, and press Ctrl-D. More Worksheet FunctionsReal Statistics Function: The Real Statistics Resource Pack provides the RANDOM function which generates a non-volatile random number. RANDOM(a, b, FALSE, seed) = random number between a and b; i.e a non-volatile version of a + (b − a) * RAND() RANDOM(a, b, TRUE, seed) = random integer between a and b, inclusive; i.e. a non-volatile version of RANDBETWEEN(a, b) If a is omitted it defaults to 0, if b is omitted it defaults to 1 and if the third argument is omitted it defaults to FALSE. If seed ≤ 0 or omitted then no seed is used, while if it is a positive value, then this value is used as a seed. A seed can be used to generate a repeatable sequence of pseudo-random values. The Real Statistics Resource Pack also provides the following array function. RANDX(nrows, seed, ncols): returns an nrows × ncols array of non-volatile random numbers between 0 and 1 where seed is as for RANDOM; the default for ncols is 1. Data Analysis ToolExcel Data Analysis Tool: In addition to the RAND and RANDBETWEEN functions, Excel provides the Random Number Generation data analysis tool which generates random numbers in the form of a table that adheres to one of several distributions. You can specify the following values with this tool: Number of Variables = number of samples. This is the number of columns in the output table generated by Excel. Number of Random Numbers = the size of each sample. This is the number of rows in the output table generated by Excel. Distribution desired: specifies one of the following distributions:
Random Seed = an optional value used to generate the first random number. You can reuse this value later to ensure that the same random numbers are produced. If this field is left blank, then a new random number will be generated each time. ExamplesExample 1: Simulate the Central Limit Theorem by generating 100 samples of size 50 from a population with a uniform distribution in the interval [50, 150]. Thus each data element in each sample is a randomly selected, equally likely value between 50 and 150. Select Data > Analysis|Data Analysis and choose the Random Number Generation data analysis tool. Fill in the dialog box that appears as shown in Figure 1.
Figure 1 – Random Number Generator Dialog Box The output is an Excel array with 50 rows and 100 columns. We next calculate the mean of each column using the AVERAGE function. The result is a row with 100 entries containing the means of each of the 100 samples. This is shown in Figure 2 (reformatted as a 10 × 10 array to fit on the screen better).
Figure 2 – Means of the 100 random samples Using Excel’s Histogram data analysis tool we now create a histogram of the 100 sample means, as shown on the right side of Figure 3.
Figure 3 – Testing the Central Limit Theorem Using the AVERAGE and STDEV.S functions, we calculate the mean and standard deviation of the 100 sample means from Figure 2. The mean of the sample means is 100.0566 (cell B7 of Figure 9.8.3) and the standard deviation is 4.318735 (cell B8). As you can see, the histogram is a somewhat imperfectly bell-shaped curve of a normal distribution. Since the sample was taken from a uniform distribution in the range [50, 150], as can be seen from Uniform Distribution, the population mean is = 100 (cell B11). Also, the standard deviation is = 28.86751 (cell B12). Based on the Central Limit Theorem, we expect that the mean of the sample means will be the population mean, which seems to be the case since 100.0566 is quite close to 100. We also expect that the standard deviation of the sample means to be
(cell B16) which is reasonably close to the observed value of 4.318735. Random sample from a distributionWe can also manually generate a random sample that follows any of the distributions supported by Excel (or the Real Statistics Resource Pack) without using the data analysis tool. E.g. to generate a 25-element sample that follows a normal distribution with a mean of 60 and a standard deviation of 20, we simply use the formula =NORM.INV(RAND(),60,20) 25 times. In column C (i.e. the column of x values) in Figure 4, we have done just that. E.g. cell C4 contains the formula =NORM.INV(B4,$G$3,$G$4) where cell B4 (and all the other cells in column B) contains the formula =RAND(). Column D contains the probability density values (i.e. labeled the y values) for each x value. E.g. cell D4 contains the formula =NORM.DIST(C4,$G$3,$G$4,FALSE) Finally, we create a scatter plot of the x values vs. the y values by highlighting the range C4:D28 and selecting Insert > Charts|Scatter as described in Excel Charts. The scatter plot shown in Figure 4 has the characteristic bell curve shape of the normal distribution. Figure 4 – Creating a sample from a normal distribution Drawing a random sample from a distributionIn a similar fashion, we can generate random samples for any of the distributions supported by Excel (or the Real Statistics Resource Pack). E.g. to generate one element from the Poisson distribution with the mean equal to 7, we use the formula =POISSON_INV(RAND(),7) where POISSON_INV is the Real Statistics function described in Poisson Distribution. We can also use the Real Statistics functions RANDOM or RANDX in place of RAND. This is especially useful if you desire a non-volatile random number or when you want to use a seed. In Excel 365 environments, RANDX can be used as a dynamic array function. E.g. to obtain an estimate of the mean of the beta distribution with α = 4 and β = 6, you can perform a Monte Carlo simulation of size 10,000 via the worksheet formula =AVERAGE(BETA.INV(RANDX(10000),4,6)) to obtain a result such as 3.99901, which is close to the theoretical value of α/( α+β) = 4/(4+6) = .4. You can also use a seed such as in the formula = AVERAGE(BETA.INV(RANDX(10000,123),4,6)) to obtain .39985. See Simulating a Distribution regarding simulation of an unknown distribution. Weighted random numbersWhen using the Excel random number formula =RANDBETWEEN(1, 4), the probability that any one of the values 1, 2, 3, or 4 occurs is 25%. We now describe a way of varying the probability that any specific value occurs. Real Statistics Function: The Real Statistics Resource Pack provides the following function. WRAND(R1) = a random integer between 1 and n where R1 is an n × 1 column range of weights. Example 2: Generate 20 random numbers from the set {1, 2, 3, 4} using the weights in range H4:H7 of Figure 5. Thus, the probability of generating a 1 is 50/(50+10+20+20) = 50%, the probability of generating a 2 is 10/(50+10+20+20) = 10%, etc. The result is shown in column J of Figure 5.
Figure 5 – Weighted random number generation Here, each cell in range J4:J23 contains the formula =WRAND($H$4:$H$7). Range L3:M7 contains a tabulation of the number of times each of the values 1, 2, 3, and 4 occurs in the range J4:J23. E.g. cell L4 contains the formula =COUNTIF(J$4:J$23,K4). We observe that the frequency percentages in the range M4:M7 are similar (but not identical) to the probabilities which result from the weights. ReferenceExcel Easy (2021) Random numbers |