You are on page 1of 5

4/20/2015

Many business situations involve a number of changing variables, so models made in Excel need to be examined for all expected combinations of these variables.

With more than one or two variables it is very difficult to manually step through all possible values and combinations of values. Instead, we can use a number of simulations whereby the variables are changed automatically.

This module introduces some methods for setting up these simulations using random number inputs that fall within controlled ranges and change on command and automatically.

M anaging random numbers

Excel provides two types of random number:

Random integers (whole numbers) and random real numbers (fractional numbers).

To generate a random integer, use =RANDOM(bottom, top). Excel will generate a whole number somewhere between bottom and top.

To generate a random real number, use =RAND(). Excel will generate a fractional number somewhere between 0 and 1.

Every time your worksheet is recalculated, all the random numbers on the worksheet will be regenerated. If set to automatic, recalculation happens every time you change a cell or formula. You can also use F9 as a shortcut to recalculate the workbook and generate a new set of random numbers, although if the workbook is large you can only recalculate the current worksheet with Shift F9.

Both the RANDOM and RAND functions return an even distribution ­ i.e. you are just as likely to get each number in the distribution.

For example, if you use RANDBETWEEN(1,10), and you press F9 1,000 times, you can expect to see an approximately even number (100) of each integer from 1 – 10.

Of course this won’t happen exactly due to the statistical process used in generating the random numbers, but over the long term – say millions of iterations ­ the distribution will be reasonably close to even.

Distributions

In nature and in business, many processes and variables don’t follow an even distribution, since you are more likely to get some values of a variable than others.

A very comm on distribution i s the Normal Distribution . DASHBOARD SUPPORT The Norm al Distribution de scribes the curve of variations in nature (and man­made objects) in many Balaji https://excelwithbusiness.com/user/course/VpdPhXBFcm/946fDKkBpP/fmBN6VCgHF 1/5 " id="pdf-obj-0-50" src="pdf-obj-0-50.jpg">

A very common distribution is the Normal Distribution.

A very comm on distribution i s the Normal Distribution . DASHBOARD SUPPORT The Norm al Distribution de scribes the curve of variations in nature (and man­made objects) in many Balaji https://excelwithbusiness.com/user/course/VpdPhXBFcm/946fDKkBpP/fmBN6VCgHF 1/5 " id="pdf-obj-0-70" src="pdf-obj-0-70.jpg">

The Normal Distribution describes the curve of variations in nature (and man­made objects) in many

Balaji

4/20/2015

COURSE

Download .xlsx file M odules included Modules excluded Modules completed Current module The attached resource shows the theory behind the Normal Distribution, and the derivation of the formula for generating normally distributed random numbers. To generate a real number in a normal distribution with a given mean and standard deviation [SD], use: =NORMINV(RAND(),mean,SD) There are several other types of distribution used in business analysis, including the Triangular distribution (often used in interest­rate simulations) and the Poisson distribution (used for arrival­ time statistics in call centres and customer­service situations). Testing with random numbers Using random numbers is an excellent way to visually test spreadsheets for formula performance and formatting. (We saw this in the previous module on Conditional Formatting: Module 4 ­ Focus on Results.) There are times when you might want to test a formula with a non­standard distribution of random numbers. For example, if we had a business process where: 20% of results are A 30% of results are B 50% of results are C We could use the CHOOSE function for testing, as follows: =CHOOSE (RANDBETWEEN(1,10),"A","A","B","B","B","C","C","C","C","C") The RANDBETWEEN part designates a number between 1 and 10, and the CHOOSE function chooses a resulting letter out of the list based on that number. We could also use VLOOKUP with a random key to extract one member from a table of potential samples. Random numbers and simulation https://excelwithbusiness.com/user/course/VpdPhXBFcm/946fDKkBpP/fmBN6VCgHF 2/5 " id="pdf-obj-1-9" src="pdf-obj-1-9.jpg">

SHOW SYLLABUS

MODULES
✓✓ ✓✓ ✓✓ ✓

Module Key

### Testing and Simulating Models

• Biological measures such as blood pressure and cholesterol measures are normally distributed in adults

• M odules included

Modules excluded Modules completed Current module

The attached resource shows the theory behind the Normal Distribution, and the derivation of the formula for generating normally distributed random numbers.

To generate a real number in a normal distribution with a given mean and standard deviation [SD], use:

=NORMINV(RAND(),mean,SD)

There are several other types of distribution used in business analysis, including the Triangular distribution (often used in interest­rate simulations) and the Poisson distribution (used for arrival­ time statistics in call centres and customer­service situations).

Testing with random numbers

Using random numbers is an excellent way to visually test spreadsheets for formula performance and formatting. (We saw this in the previous module on Conditional Formatting: Module 4 ­ Focus on Results.)

There are times when you might want to test a formula with a non­standard distribution of random numbers.

• 20% of results are A

• 30% of results are B

• 50% of results are C

We could use the CHOOSE function for testing, as follows:

=CHOOSE(RANDBETWEEN(1,10),"A","A","B","B","B","C","C","C","C","C")

The RANDBETWEEN part designates a number between 1 and 10, and the CHOOSE function chooses a resulting letter out of the list based on that number.

We could also use VLOOKUP with a random key to extract one member from a table of potential samples.

Random numbers and simulation

4/20/2015

A Monte Carlo method is a technique that involves using random numbers and probability to solve problems. The term ‘Monte Carlo’ was coined in reference to games of chance, a popular attraction in Monte Carlo, Monaco.

Monte Carlo simulation is a method for evaluating a model using sets of random numbers as inputs. This method is often used when the model involves uncertain input parameters.

Static models (i.e. models where you get the same results no matter how many times you recalculate them) are called deterministic.

Monte Carlo simulation, instead of giving a deterministic single result, gives a range of possible results, and the overall solution can be identified using the mean of the results, the standard deviation of the results or the most likely result etc.

In the deterministic model below, with known Materials Cost and Demand Quantity, we can determine the Profit exactly. We can then use simulation to see the effect on Profit as the input parameters vary randomly.

The term ‘stochastic’ is used to describe a system ‘involving or subject to probabilistic behaviour,’ and is often used with regard to models driven by random numbers.

Our 'Production Cost Model' example shows how the simple plan can be changed from a deterministic model to a stochastic model.

We replace the fixed amounts for Materials Cost and Demand Quantity with random inputs that change every time the worksheet is refreshed (by pressing F9 or by automatic recalculation).

4/20/2015

Using the RANDBETWEEN function makes this a stochastic model, and a new figure for Profit is computed every time the worksheet is refreshed.

So now, in this model:

• Materials Cost randomises across all values between 5 and 9

• Demand Quantity randomises across all values between 80 and 180

• Movements in Materials Cost are independent of movements in Demand Quantity

This model can be varied by applying a Normal Distribution to the inputs instead of an even distribution if you believe that Materials Cost and Demand Quantity are not evenly distributed in the marketplace.#

Method in Action

03:55

4/20/2015

Using random numbers and a random distribution to estimate results from a model. See Questions 1 ­ 4